Class PageRenderer
- java.lang.Object
-
- org.apache.wicket.request.handler.render.PageRenderer
-
- Direct Known Subclasses:
WebPageRenderer
public abstract class PageRenderer extends Object
Delegate responsible for rendering the page. Depending on the implementation (web, test, portlet, etc.) the delegate may or may not support the redirect policy set in theRenderPageRequestHandler
.- Author:
- Matej Knopp
-
-
Constructor Summary
Constructors Constructor Description PageRenderer(RenderPageRequestHandler renderPageRequestHandler)
Construct.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected boolean
enableRedirectForStatelessPage()
When the page renders to buffer and it is still stateless after rendering, this flag determines whether the redirect will take place or not.protected IRequestablePage
getPage()
protected IPageProvider
getPageProvider()
protected RenderPageRequestHandler.RedirectPolicy
getRedirectPolicy()
protected RenderPageRequestHandler
getRenderPageRequestHandler()
protected String
getSessionId()
protected boolean
isOnePassRender()
protected boolean
isRedirectToBuffer()
protected boolean
isRedirectToRender()
protected boolean
isSessionTemporary()
abstract void
respond(RequestCycle requestCycle)
Render the response using giveRequestCycle
.
-
-
-
Constructor Detail
-
PageRenderer
public PageRenderer(RenderPageRequestHandler renderPageRequestHandler)
Construct.- Parameters:
renderPageRequestHandler
-
-
-
Method Detail
-
getPageProvider
protected IPageProvider getPageProvider()
- Returns:
- page provider
-
getRedirectPolicy
protected RenderPageRequestHandler.RedirectPolicy getRedirectPolicy()
- Returns:
- redirect policy
-
getRenderPageRequestHandler
protected RenderPageRequestHandler getRenderPageRequestHandler()
- Returns:
- the request handler
-
getPage
protected IRequestablePage getPage()
- Returns:
- page instance
-
isOnePassRender
protected boolean isOnePassRender()
-
isRedirectToRender
protected boolean isRedirectToRender()
-
isRedirectToBuffer
protected boolean isRedirectToBuffer()
-
getSessionId
protected String getSessionId()
- Returns:
- the current session id for stateful pages and
null
for stateless pages
-
isSessionTemporary
protected boolean isSessionTemporary()
- Returns:
- whether the current session is temporary
-
enableRedirectForStatelessPage
protected boolean enableRedirectForStatelessPage()
When the page renders to buffer and it is still stateless after rendering, this flag determines whether the redirect will take place or not.By default we will redirect. This is so we do not end up having the browser be on a listener URL. A simple scenario is calling
setResponsePage(new StatelessPage())
inside form'sonSubmit()
or link'sonClick()
callbacks, or any other request listener callback. What will happen is that the browser will be on URL like./wicket/page?0-2.IFormSubmitListener-form
, and we will not redirect - leaving the browser on such URL. This is a worse alternative then saving one redirect because it may cause problems if user presses the refresh button in the browser.- Returns:
- redirect flag
-
respond
public abstract void respond(RequestCycle requestCycle)
Render the response using giveRequestCycle
.- Parameters:
requestCycle
-
-
-