问题描述
在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?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!