Module org.apache.wicket.core
Package org.apache.wicket.request.cycle
Class PageRequestHandlerTracker
java.lang.Object
org.apache.wicket.request.cycle.PageRequestHandlerTracker
- All Implemented Interfaces:
IRequestCycleListener
Registers and retrieves first and last executed
IPageRequestHandler
in a request cycle.
Can be used to find out what is the requested page and what is the actual response page.
To use it an application needs to register it with:
application.getRequestCycleListeners().add(new PageRequestHandlerTracker());
The result can then be accessed at the end of each RequestCycle
with:
IPageRequestHandler first = PageRequestHandlerTracker.getFirstHandler(RequestCycle.get());
IPageRequestHandler last = PageRequestHandlerTracker.getLastHandler(RequestCycle.get());
- Since:
- 1.5.8
-
Field Summary
Modifier and TypeFieldDescriptionstatic final MetaDataKey<IPageRequestHandler>
The key for the first handlerstatic final MetaDataKey<IPageRequestHandler>
The key for the last handler -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic IPageRequestHandler
getFirstHandler
(RequestCycle cycle) retrieves first handler from the request cyclestatic IPageRequestHandler
getLastHandler
(RequestCycle cycle) retrieves last handler from request cyclevoid
onRequestHandlerResolved
(RequestCycle cycle, IRequestHandler handler) Called when anIRequestHandler
is resolved and will be executed.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.wicket.request.cycle.IRequestCycleListener
onBeginRequest, onDetach, onEndRequest, onException, onExceptionRequestHandlerResolved, onRequestHandlerExecuted, onRequestHandlerScheduled, onUrlMapped
-
Field Details
-
FIRST_HANDLER_KEY
The key for the first handler -
LAST_HANDLER_KEY
The key for the last handler
-
-
Constructor Details
-
PageRequestHandlerTracker
public PageRequestHandlerTracker()
-
-
Method Details
-
onRequestHandlerResolved
Description copied from interface:IRequestCycleListener
Called when anIRequestHandler
is resolved and will be executed.- Specified by:
onRequestHandlerResolved
in interfaceIRequestCycleListener
-
getLastHandler
retrieves last handler from request cycle- Parameters:
cycle
-- Returns:
- last handler
-
getFirstHandler
retrieves first handler from the request cycle- Parameters:
cycle
-- Returns:
- first handler
-