在 Wicket 1.4 中我使用了我自己的WebRequestCycle
在分离时将页面存储在会话中 - 以实现“后退”链接。
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
在它的位置。
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);
}
});
But RequestCycle
没有getReponsePage()
。我在哪里可以找到这些信息?
请参阅迁移指南:
https://cwiki.apache.org/confluence/display/WICKET/RequestCycle+in+Wicket+1.5 https://cwiki.apache.org/confluence/display/WICKET/RequestCycle+in+Wicket+1.5(跟踪请求和响应页面)
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)