Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The new RequestCycle implementation doesn't provide methods for getting the page for the current request but this information can be easily tracked with the following IRequestCycleProvider implementation:

...

titlePageTrackingRequestCycleListener
borderStylesolid

...

a IRequestCycleListener. Wicket itself uses org.apache.wicket.

...

To get the requested page you can do: RequestCycle.get().getMetaData(PageTrackingRequestCycleListener.REQUESTED_PAGE).

During processing of the request another IRequestHandler can be scheduled (e.g. with org.apache.wicket.request.cycle.RequestCycle.setResponsePage(Class<? extends IRequestablePage>, PageParameters) method, or directly with org.apache.wicket.request.cycle.RequestCycle.scheduleRequestHandlerAfterCurrent(IRequestHandler)).For each of these a notification will be send to all registered IRequestCycleListeners and they can track the page that is going to be rendered (the response page)protocol.http.RequestLoggerRequestCycleListener to track the requested page and the response page for a request. You may use it as inspiration if it doesn't fit your needs as it is.

Exception handling

Whenever an exception occurs org.apache.wicket.request.cycle.IRequestCycleListener.onException(RequestCycle, Exception) will be called for all registered IRequestCycleListeners. The first one that knows how to handle this kind of exception can return IRequestHandler implementation that will be used to proceed the processing of the request. If none of the IRequestCycleListeners can handle it (i.e. all of them return null) then Wicket will use the configured org.apache.wicket.request.IExceptionMapper. The default one will show the configured error pages (internal error, page expired, access denied, etc.).