Class RenderPageRequestHandler
- java.lang.Object
-
- org.apache.wicket.core.request.handler.RenderPageRequestHandler
-
- All Implemented Interfaces:
IPageClassRequestHandler
,IPageRequestHandler
,ILoggableRequestHandler
,IRequestHandler
public class RenderPageRequestHandler extends Object implements IPageRequestHandler, IPageClassRequestHandler, ILoggableRequestHandler
IRequestHandler
that renders page instance. Depending on theredirectPolicy
flag and current request strategy the handler either just renders the page to the response, or redirects to render the page.REDIRECT_TO_BUFFER
strategy is also supported.- Author:
- Matej Knopp
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RenderPageRequestHandler.RedirectPolicy
Determines whether Wicket does a redirect when rendering a page
-
Constructor Summary
Constructors Constructor Description RenderPageRequestHandler(Class<? extends IRequestablePage> pageClass)
Constructor.RenderPageRequestHandler(Class<? extends IRequestablePage> pageClass, PageParameters parameters)
Constructor.RenderPageRequestHandler(IPageProvider pageProvider)
Construct.RenderPageRequestHandler(IPageProvider pageProvider, RenderPageRequestHandler.RedirectPolicy redirectPolicy)
Construct.RenderPageRequestHandler(IRequestablePage page)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
detach(IRequestCycle requestCycle)
This method is called at the end of a request cycle to indicate that processing is done and that cleaning up of the subject(s) of this target may be done.PageLogData
getLogData()
Returns the collected log data for this request handler and should never throw an exception.IRequestablePage
getPage()
Returns the page.Class<? extends IRequestablePage>
getPageClass()
Returns the page classInteger
getPageId()
Returns the page id.PageParameters
getPageParameters()
IPageProvider
getPageProvider()
RenderPageRequestHandler.RedirectPolicy
getRedirectPolicy()
Integer
getRenderCount()
Returns the number of times this page has been rendered.boolean
isPageInstanceCreated()
Checks if the page instance is already created or if it will be created whenIPageRequestHandler.getPage()
is calledvoid
respond(IRequestCycle requestCycle)
Generates a response.
-
-
-
Constructor Detail
-
RenderPageRequestHandler
public RenderPageRequestHandler(Class<? extends IRequestablePage> pageClass)
Constructor.- Parameters:
pageClass
- The class of the page to render
-
RenderPageRequestHandler
public RenderPageRequestHandler(Class<? extends IRequestablePage> pageClass, PageParameters parameters)
Constructor.- Parameters:
pageClass
- The class of the page to renderparameters
- Wrapped query string parameters.
-
RenderPageRequestHandler
public RenderPageRequestHandler(IRequestablePage page)
Constructor.- Parameters:
page
- The page to render
-
RenderPageRequestHandler
public RenderPageRequestHandler(IPageProvider pageProvider)
Construct. Renders the page with a redirect if necessary.- Parameters:
pageProvider
-
-
RenderPageRequestHandler
public RenderPageRequestHandler(IPageProvider pageProvider, RenderPageRequestHandler.RedirectPolicy redirectPolicy)
Construct.- Parameters:
pageProvider
-redirectPolicy
-
-
-
Method Detail
-
getPageProvider
public IPageProvider getPageProvider()
- Returns:
- page provider
-
getRedirectPolicy
public RenderPageRequestHandler.RedirectPolicy getRedirectPolicy()
- Returns:
- redirect policy
-
getPageClass
public Class<? extends IRequestablePage> getPageClass()
Description copied from interface:IPageClassRequestHandler
Returns the page class- Specified by:
getPageClass
in interfaceIPageClassRequestHandler
- Returns:
- page class
-
getPageId
public Integer getPageId()
Description copied from interface:IPageRequestHandler
Returns the page id.- Specified by:
getPageId
in interfaceIPageRequestHandler
- Returns:
- page id
-
getPageParameters
public PageParameters getPageParameters()
- Specified by:
getPageParameters
in interfaceIPageClassRequestHandler
- Returns:
- page parameters
-
detach
public void detach(IRequestCycle requestCycle)
Description copied from interface:IRequestHandler
This method is called at the end of a request cycle to indicate that processing is done and that cleaning up of the subject(s) of this target may be done.- Specified by:
detach
in interfaceIRequestHandler
- Parameters:
requestCycle
- the current request cycle
-
getLogData
public PageLogData getLogData()
Description copied from interface:ILoggableRequestHandler
Returns the collected log data for this request handler and should never throw an exception. This method is never called before the request handler is detached.- Specified by:
getLogData
in interfaceILoggableRequestHandler
- Returns:
- The collected log data.
-
getPage
public IRequestablePage getPage()
Description copied from interface:IPageRequestHandler
Returns the page. Be aware that the page can be instantiated if this wasn't the case already.- Specified by:
getPage
in interfaceIPageRequestHandler
- Returns:
- page instance
-
respond
public void respond(IRequestCycle requestCycle)
Description copied from interface:IRequestHandler
Generates a response.- Specified by:
respond
in interfaceIRequestHandler
- Parameters:
requestCycle
- the current request cycle
-
isPageInstanceCreated
public final boolean isPageInstanceCreated()
Description copied from interface:IPageRequestHandler
Checks if the page instance is already created or if it will be created whenIPageRequestHandler.getPage()
is called- Specified by:
isPageInstanceCreated
in interfaceIPageRequestHandler
- Returns:
true
iff page instance is already created
-
getRenderCount
public final Integer getRenderCount()
Description copied from interface:IPageRequestHandler
Returns the number of times this page has been rendered.- Specified by:
getRenderCount
in interfaceIPageRequestHandler
- Returns:
- the number of times this page has been rendered.
- See Also:
IRequestablePage.getRenderCount()
-
-