Package org.apache.tapestry5.services

# Class StreamPageContent

java.lang.Object
org.apache.tapestry5.services.StreamPageContent

public final class StreamPageContent extends Object
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

  Constructors
  Constructor
  Description
  `StreamPageContent()`
  Creates 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 Type
  Method
  Description
  `Object[]`
  `getPageActivationContext()`
  Returns the activation context of the page.
  `Class<?>`
  `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.
  `boolean`
  `isBypassActivation()`
  `StreamPageContent`
  `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.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## 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

    public StreamPageContent(Class<?> pageClass)
    Renders the page using an empty page activation context.
    Parameters:
      `pageClass` - class of the page to render

  - ### StreamPageContent

    public StreamPageContent(Class<?> pageClass, Object... pageActivationContext)
    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 per `RequestGlobals.getActivePageName()`)
      `pageActivationContext` - activation context of the page

- ## Method Details

  - ### getPageClass

    public Class<?> 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

    public Object[] getPageActivationContext()
    Returns the activation context of the page. May return null to indicate an empty activation context.

  - ### withoutActivation

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

    public boolean isBypassActivation()
    Returns:
      true if configured to bypass activation