Package org.apache.tapestry5
Class PageCallback
- java.lang.Object
-
- org.apache.tapestry5.PageCallback
-
- All Implemented Interfaces:
Serializable
@ImmutableSessionPersistedObject public class PageCallback extends Object implements Serializable
A way of capturing the name of a page and the page activation context so that, at a future date, the page can be invoked with that data. This kind of callback is very useful when creating more complicated workflows, where access to a page is "interrupted" with some operation before returning (via a callback) to the original flow. Since the callback is serializable, it can be stored in the session.- Since:
- 5.2.0
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description PageCallback(String pageName)
PageCallback(String pageName, String[] activationContext)
PageCallback(String pageName, EventContext activationContext)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
activationContextDescription()
Returns the activation context as a string of value separated by slashes.String
getPageName()
protected boolean
hasActivationContext()
Does the activation context have any values? Used, typically, inside an override oftoString()
.Link
toLink(PageRenderLinkSource linkSource)
Converts the callback (the page name and activation context) to a link; such a link may be returned from a event handler method to cause Tapestry to redirect to the page.String
toString()
-
-
-
Constructor Detail
-
PageCallback
public PageCallback(String pageName, String[] activationContext)
-
PageCallback
public PageCallback(String pageName, EventContext activationContext)
-
PageCallback
public PageCallback(String pageName)
-
-
Method Detail
-
getPageName
public String getPageName()
-
hasActivationContext
protected final boolean hasActivationContext()
Does the activation context have any values? Used, typically, inside an override oftoString()
.
-
activationContextDescription
protected final String activationContextDescription()
Returns the activation context as a string of value separated by slashes. Typically used inside an override oftoString()
.
-
toLink
public Link toLink(PageRenderLinkSource linkSource)
Converts the callback (the page name and activation context) to a link; such a link may be returned from a event handler method to cause Tapestry to redirect to the page. Most of the details are encapsulated inside thePageRenderLinkSource
service.- Parameters:
linkSource
- used to generate the link- Returns:
- link corresponding to this callback
-
-