public class PageRequestHandlerTracker extends Object implements IRequestCycleListener
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());
Modifier and Type | Field and Description |
---|---|
static MetaDataKey<IPageRequestHandler> |
FIRST_HANDLER_KEY
The key for the first handler
|
static MetaDataKey<IPageRequestHandler> |
LAST_HANDLER_KEY
The key for the last handler
|
Constructor and Description |
---|
PageRequestHandlerTracker() |
Modifier and Type | Method and Description |
---|---|
static IPageRequestHandler |
getFirstHandler(RequestCycle cycle)
retrieves first handler from the request cycle
|
static IPageRequestHandler |
getLastHandler(RequestCycle cycle)
retrieves last handler from request cycle
|
void |
onRequestHandlerResolved(RequestCycle cycle,
IRequestHandler handler)
Called when an
IRequestHandler is resolved and will be executed. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
onBeginRequest, onDetach, onEndRequest, onException, onExceptionRequestHandlerResolved, onRequestHandlerExecuted, onRequestHandlerScheduled, onUrlMapped
public static final MetaDataKey<IPageRequestHandler> FIRST_HANDLER_KEY
public static final MetaDataKey<IPageRequestHandler> LAST_HANDLER_KEY
public void onRequestHandlerResolved(RequestCycle cycle, IRequestHandler handler)
IRequestCycleListener
IRequestHandler
is resolved and will be executed.onRequestHandlerResolved
in interface IRequestCycleListener
public static IPageRequestHandler getLastHandler(RequestCycle cycle)
cycle
- public static IPageRequestHandler getFirstHandler(RequestCycle cycle)
cycle
- Copyright © 2006–2022 Apache Software Foundation. All rights reserved.