3

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);
    }
}); 

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);
    }
});

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

Stijn Geukens
  • 15,454
  • 8
  • 66
  • 101
Duncan McGregor
  • 17,665
  • 12
  • 64
  • 118

1 Answers1

4

See the migration guide:

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

Krayo
  • 2,492
  • 4
  • 27
  • 45
rotsch
  • 1,909
  • 16
  • 36
  • Obviously the page's content or the functionality of the mentioned class `RequestLoggerRequestCycleListener` has changed in the meantime. The source code does not even contain the word "page". If anyone could come up with a little bit more info, I'd be very happy. – peterp Jul 26 '12 at 09:13
  • 1
    The class `RequestLoggerRequestCycleListener` was never mentioned... what's your actual problem? Please open a new question if your question is not related to this problem/solution. – rotsch Jul 26 '12 at 09:54