如何从Wicket 1.5中的RequestCycle获取responsePage? [英] How can I get the responsePage from a RequestCycle in Wicket 1.5?

查看:96
本文介绍了如何从Wicket 1.5中的RequestCycle获取responsePage?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Wicket 1.4中,我使用自己的WebRequestCycle在页面被分离时将其存储在会话中-以实现后退"链接.

In Wicket 1.4 I used my own WebRequestCycle to store the page in the session when it was detached - in order to implement a 'back' link.

getRequestCycleListeners().add(new AbstractRequestCycleListener() {
    @Override public void onDetach(RequestCycle cycle) {
        squirrelAwayPreviousPage(cycle);
    }
    private void squirrelAwayPreviousPage(RequestCycle cycle) {
        Page responsePage = cycle.getResponse();
        if (responsePage != null)
            ((MySession) getSession()).setPreviousPage(responsePage);
    }
}); 

现在Wicket 1.5中的WebRequestCycle已经消失了,我应该在其位置使用RequestCycleListener.

Now in Wicket 1.5 WebRequestCycle has gone, and I'm supposed to use a RequestCycleListener in its place.

getRequestCycleListeners().add(new AbstractRequestCycleListener() {
    @Override public void onDetach(RequestCycle cycle) {
        squirrelAwayPreviousPage(cycle);
    }
    private void squirrelAwayPreviousPage(RequestCycle cycle) {
        Page responsePage = **cycle.getResponsePage()**;
        if (responsePage != null)
            ((MySession) getSession()).setPreviousPage(responsePage);
    }
});

但是RequestCycle没有getReponsePage().我在哪里可以找到这些信息?

But RequestCycle doesn't have a getReponsePage(). Where can I find this information?

推荐答案

请参阅迁移指南:

https://cwiki.apache.org/confluence/display/WICKET/RequestCycle + in + Wicket + 1.5 (跟踪请求和响应页面)

https://cwiki.apache.org/confluence/display/WICKET/RequestCycle+in+Wicket+1.5 (Tracking requested and response pages)

这篇关于如何从Wicket 1.5中的RequestCycle获取responsePage?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆