Package org.apache.tapestry5.services
Class StreamPageContent
java.lang.Object
org.apache.tapestry5.services.StreamPageContent
An event handler method may return an instance of this class to trigger the rendering
of a particular page without causing a redirect to that page; the rendering takes place as part
of the original component event request, thus forming the opposite of Tapestry's normal
redirect-after-event behavior.
The page will be activated using the provided page activation context (or an empty page activation
context). Starting with 5.3, the page activation step can be bypassed. Rendering occurs using
the standard
PageRenderRequestHandler
pipeline.- Since:
- 5.2.0
-
Constructor Summary
ConstructorsConstructorDescriptionCreates an instance that streams the activate page's content (that is,getPageClass()
will be null).StreamPageContent
(Class<?> pageClass) Renders the page using an empty page activation context.StreamPageContent
(Class<?> pageClass, Object... pageActivationContext) Renders the page using the supplied page activation context. -
Method Summary
Modifier and TypeMethodDescriptionObject[]
Returns the activation context of the page.Class<?>
Returns the class of the page to render, or null to indicate that the active page for the request should simply be re-rendered.boolean
Returns a new StreamPageInstance with the bypass activation flag set to true, such that page activation will be bypassed when the page is rendered.
-
Constructor Details
-
StreamPageContent
public StreamPageContent()Creates an instance that streams the activate page's content (that is,getPageClass()
will be null). Unless otherwise configured, page activation will take place.- Since:
- 5.4
-
StreamPageContent
Renders the page using an empty page activation context.- Parameters:
pageClass
- class of the page to render
-
StreamPageContent
Renders the page using the supplied page activation context.- Parameters:
pageClass
- class of the page to render, or null to render the currently active page (as perRequestGlobals.getActivePageName()
)pageActivationContext
- activation context of the page
-
-
Method Details
-
getPageClass
Returns the class of the page to render, or null to indicate that the active page for the request should simply be re-rendered. -
getPageActivationContext
Returns the activation context of the page. May return null to indicate an empty activation context. -
withoutActivation
Returns a new StreamPageInstance with the bypass activation flag set to true, such that page activation will be bypassed when the page is rendered.- Returns:
- new instance
-
isBypassActivation
- Returns:
- true if configured to bypass activation
-