org.apache.wicket.request.handler
Class RenderPageRequestHandler

java.lang.Object
  extended by org.apache.wicket.request.handler.RenderPageRequestHandler
All Implemented Interfaces:
IPageClassRequestHandler, IPageRequestHandler, IRequestHandler

public class RenderPageRequestHandler
extends java.lang.Object
implements IPageRequestHandler, IPageClassRequestHandler

IRequestHandler that renders page instance. Depending on the redirectPolicy 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
static class RenderPageRequestHandler.RedirectPolicy
          Determines whether Wicket does a redirect when rendering a page
 
Constructor Summary
RenderPageRequestHandler(IPageProvider pageProvider)
          Construct.
RenderPageRequestHandler(IPageProvider pageProvider, RenderPageRequestHandler.RedirectPolicy redirectPolicy)
          Construct.
 
Method Summary
 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.
 IRequestablePage getPage()
          Returns the page.
 java.lang.Class<? extends IRequestablePage> getPageClass()
          Returns the page class
 java.lang.Integer getPageId()
          Returns the page id.
 PageParameters getPageParameters()
          
 IPageProvider getPageProvider()
           
 RenderPageRequestHandler.RedirectPolicy getRedirectPolicy()
           
 java.lang.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 when IPageRequestHandler.getPage() is called
 void respond(IRequestCycle requestCycle)
          Generates a response.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

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 java.lang.Class<? extends IRequestablePage> getPageClass()
Returns the page class

Specified by:
getPageClass in interface IPageClassRequestHandler
Returns:
page class

getPageId

public java.lang.Integer getPageId()
Description copied from interface: IPageRequestHandler
Returns the page id.

Specified by:
getPageId in interface IPageRequestHandler
Returns:
page id
See Also:
IPageRequestHandler.getPageId()

getPageParameters

public PageParameters getPageParameters()

Specified by:
getPageParameters in interface IPageClassRequestHandler
Returns:
page parameters

detach

public 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.

Specified by:
detach in interface IRequestHandler
Parameters:
requestCycle - the current request cycle

getPage

public IRequestablePage getPage()
Returns the page. Be aware that the page can be instantiated if this wasn't the case already.

Specified by:
getPage in interface IPageRequestHandler
Returns:
page instance

respond

public void respond(IRequestCycle requestCycle)
Generates a response.

Specified by:
respond in interface IRequestHandler
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 when IPageRequestHandler.getPage() is called

Specified by:
isPageInstanceCreated in interface IPageRequestHandler
Returns:
true iff page instance is not yet created

getRenderCount

public final java.lang.Integer getRenderCount()
Description copied from interface: IPageRequestHandler
Returns the number of times this page has been rendered.

Specified by:
getRenderCount in interface IPageRequestHandler
Returns:
the number of times this page has been rendered.
See Also:
IRequestablePage.getRenderCount()


Copyright © 2006-2011 Apache Software Foundation. All Rights Reserved.