# com.bea.wlw.netui.pageflow
PageFlowController Class

public abstract class PageFlowController
extends `FlowController`

Base class for user-defined state and controller logic associated with a particular web application directory. The source code for this class lives in the directory with a ".jpf" extension, and is automatically recompiled by the server whenever necessary. When a request arrives for any ".jpf", ".jsp", or ".do" in the directory, an instance of the PageFlowController class is set as the current page flow, and remains in the session until a different one becomes active.

The user's PageFlowController class handles actions that are most commonly raised by user interaction with JSP files. The actions are handled by action methods that perform arbitrary logic and determine the next URI to be displayed.

Actions that are not handled by the current PageFlowController "bubble" up to the current `GlobalApp``` instance.

Data in the current PageFlowController instance can be accessed by databinding tags using the `pageFlow` scope.

Related Topics

``GlobalApp``

Hierarchy
  `Object`
  `Action`
  `FlowController`
  `PageFlowController`

All Implemented Interfaces
  `EventListener`, `HttpSessionBindingListener`, `PageFlowConstants`, `Serializable`

## Field Summary

Fields from org.apache.struts.action`.`Action``
`ACTION_SERVLET_KEY, APPLICATION_KEY, DATA_SOURCE_KEY, defaultLocale, ERROR_KEY, EXCEPTION_KEY, FORM_BEANS_KEY, FORWARDS_KEY, LOCALE_KEY, MAPPING_KEY, MAPPINGS_KEY, MESSAGE_KEY, MESSAGES_KEY, MULTIPART_KEY, PLUG_INS_KEY, REQUEST_PROCESSOR_KEY, servlet, SERVLET_KEY, TRANSACTION_TOKEN_KEY`

Fields from interface com.bea.wlw.netui.pageflow`.`PageFlowConstants``
``ACTION_EXTENSION`, `ACTION_EXTENSION_LEN`, `ACTION_OVERRIDE`, `BEGIN_ACTION_NAME`, `BEGIN_ACTION_PATH`, `DEFAULT_FORWARD_OVERFLOW_COUNT`, `DEFAULT_NESTING_OVERFLOW_COUNT`, `FORWARD_OVERFLOW_COUNT_PARAM`, `GLOBALAPP_CLASSNAME`, `GLOBALAPP_MEMBER_NAME`, `GLOBALAPP_MODULE_CONTEXT_PATH`, `GLOBALAPP_SOURCEFILE_NAME`, `INTERNAL_VAR_PREFIX`, `ISNESTABLE_VAR_NAME`, `JPF_EXTENSION`, `JPF_MODULE_CONFIG_EXTENSION`, `JPF_MODULE_CONFIG_GEN_DIR`, `JPF_MODULE_CONFIG_PREFIX`, `NESTING_OVERFLOW_COUNT_PARAM`, `PROCESS_ROLES_FAILED_ATTR`, `WEBINF_DIR``

## Constructor Summary

PageFlowController() Default constructor.

## Method Summary

`public void` | `ensureFailover`(`HttpServletRequest` request) Ensures that any changes to this FlowController will be replicated in a cluster (for failover), even if the replication scheme uses a change-detection algorithm that relies on HttpSession.setAttribute to be aware of changes.
`protected `String`` | `getCurrentForwardPath`() Get the webapp-relative URI for the most recent page (in this page flow) shown to the user.
`public final `PreviousPageInfo`` | `getCurrentPageInfo`() Get information about the most recent page (in this page flow) shown to the user.
`public `String`` | `getDisplayName`()
`public `String`` | `getModulePath`() Get the Struts module path for this page flow.
`public final `PreviousActionInfo`` | `getPreviousActionInfo`() Get information about the most recent action run in this page flow.
`protected `String`` | `getPreviousActionURI`() Get the URI for the most recent action in this PageFlowController.
`protected `ActionForm`` | `getPreviousForm`() Get the form instance from the most recent action execution in this PageFlowController.
`protected `String`` | `getPreviousForwardPath`() Get the webapp-relative URI for the previous page (in this page flow) shown to the user.
`public final `PreviousPageInfo`` | `getPreviousPageInfo`() Get information about the previous page (in this page flow) shown to the user.
`protected `String`` | `getTaxonomy`() Get the "resource taxonomy": a period-separated list that starts with the current web application name, continues through all of this PageFlowController's parent directories, and ends with this PageFlowController's class name.
`public `String`` | `getURI`() Get the URI for addressing this PageFlowController.
`protected boolean` | `isNestable`() Tell whether this PageFlowController can be "nested", i.e., if it can be invoked from another page flow with the intention of returning to the original one.
`public boolean` | `isPageFlow`() Tell whether this is a PageFlowController.
`public void` | `valueUnbound`(`HttpSessionBindingEvent` event) Callback when this page flow is removed from the user session.

Methods from `com.bea.wlw.netui.pageflow.`FlowController``
``afterAction`, `alwaysTrackPreviousAction`, `alwaysTrackPreviousPage`, `beforeAction`, `execute`, `getActionMethod`, `getActions`, `getCurrentActionName`, `getMapping`, `getModuleConfig`, `getRequest`, `getResponse`, `getServlet`, `getSession`, `handleException`, `invokeActionMethod`, `isAction`, `login`, `logout`, `onCreate`, `onDestroy`, `onDestroy`, `resolveAction`, `retrieveUserLocale`, `sendError`, `valueBound`,`

Methods from `org.apache.struts.action.`Action``
`execute, execute, generateToken, getDataSource, getDataSource, getLocale, getResources, getResources, getResources, getServlet, isCancelled, isTokenValid, isTokenValid, perform, perform, resetToken, saveErrors, saveMessages, saveToken, setLocale, setServlet, toHex`

Methods from class `java.lang.`Object``
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Methods from interface `javax.servlet.http.`HttpSessionBindingListener``
`valueBound, valueUnbound`

## Constructor Detail

### PageFlowController

    public PageFlowController()

  Default constructor.

## Method Detail

### ensureFailover(HttpServletRequest) Method

    public void ensureFailover(HttpServletRequest request)

Ensures that any changes to this FlowController will be replicated in a cluster (for failover), even if the replication scheme uses a change-detection algorithm that relies on HttpSession.setAttribute to be aware of changes.

Overrides
  `FlowController.ensureFailover(HttpServletRequest)`

#### Parameters

request
  the current HttpServletRequest

### getCurrentForwardPath() Method

    protected String getCurrentForwardPath()

Get the webapp-relative URI for the most recent page (in this page flow) shown to the user.

Note: if the current page flow does not use a `@jpf:forward` with a `return-to="previousPage"` or `return-to="currentPage"` attribute, then this method will always return `null` by default. To enable it in this situation, add the following method to the page flow:

> `protected boolean alwaysTrackPreviousPage()
> {
> return true;
> }
> `

#### Returns

a String that is the URI path for the most recent page shown to the user.

Related Topics

``PageFlowController.getPreviousPageInfo()``
``PageFlowController.getCurrentPageInfo()``
``PageFlowController.getPreviousActionInfo()``
``PageFlowController.getPreviousActionURI()``
``PageFlowController.getPreviousForm()``
``PageFlowController.getPreviousForwardPath()``

### getCurrentPageInfo() Method

    public final PreviousPageInfo getCurrentPageInfo()

Get information about the most recent page (in this page flow) shown to the user.

Note: if the current page flow does not use a `@jpf:forward` with a `return-to="previousPage"` or `return-to="currentPage"` attribute, then this method will always return `null` by default. To enable it in this situation, add the following method to the page flow:

> `protected boolean alwaysTrackPreviousPage()
> {
> return true;
> }
> `

#### Returns

a PreviousPageInfo with information about the most recent page shown to the user.

Related Topics

``PageFlowController.getPreviousPageInfo()``
``PageFlowController.getPreviousActionInfo()``
``PageFlowController.getPreviousActionURI()``
``PageFlowController.getPreviousForm()``
``PageFlowController.getPreviousForwardPath()``
``PageFlowController.getCurrentForwardPath()``

### getDisplayName() Method

    public String getDisplayName()

Overrides
  `FlowController.getDisplayName()`

### getModulePath() Method

    public String getModulePath()

Get the Struts module path for this page flow.

Overrides
  `FlowController.getModulePath()`

#### Returns

a String that is the Struts module path for this controller, and which is also the directory path from the web application root to this PageFlowController (not including the action filename).

### getPreviousActionInfo() Method

    public final PreviousActionInfo getPreviousActionInfo()

Get information about the most recent action run in this page flow.

Note: if the current page flow does not use a `@jpf:forward` with a `return-to="previousAction"` attribute, then this method will always return `null` by default. To enable it in this situation, add the following method to the page flow:

> `protected boolean alwaysTrackPreviousAction()
> {
> return true;
> }
> `

#### Returns

a PreviousActionInfo with information about the most recent action run in this page flow.

Related Topics

``PageFlowController.getPreviousPageInfo()``
``PageFlowController.getCurrentPageInfo()``
``PageFlowController.getPreviousActionURI()``
``PageFlowController.getPreviousForm()``
``PageFlowController.getPreviousForwardPath()``
``PageFlowController.getCurrentForwardPath()``

### getPreviousActionURI() Method

    protected String getPreviousActionURI()

Get the URI for the most recent action in this PageFlowController.

Note: if the current page flow does not use a `@jpf:forward` with a `return-to="previousAction"` attribute, then this method will always return `null` by default. To enable it in this situation, add the following method to the page flow:

> `protected boolean alwaysTrackPreviousAction()
> {
> return true;
> }
> `

#### Returns

a String that is the most recent URI.

Related Topics

``PageFlowController.getPreviousPageInfo()``
``PageFlowController.getCurrentPageInfo()``
``PageFlowController.getPreviousActionInfo()``
``PageFlowController.getPreviousForm()``
``PageFlowController.getPreviousForwardPath()``
``PageFlowController.getCurrentForwardPath()``

### getPreviousForm() Method

    protected ActionForm getPreviousForm()

Get the form instance from the most recent action execution in this PageFlowController.

Note: if the current page flow does not use a `@jpf:forward` with a `return-to="previousAction"` attribute, then this method will always return `null` by default. To enable it in this situation, add the following method to the page flow:

> `protected boolean alwaysTrackPreviousAction()
> {
> return true;
> }
> `

#### Returns

the ActionForm instance from the most recent action execution, or `null` if there was no ActionForm instance.

Related Topics

``PageFlowController.getPreviousPageInfo()``
``PageFlowController.getCurrentPageInfo()``
``PageFlowController.getPreviousActionInfo()``
``PageFlowController.getPreviousActionURI()``
``PageFlowController.getPreviousForwardPath()``
``PageFlowController.getCurrentForwardPath()``

### getPreviousForwardPath() Method

    protected String getPreviousForwardPath()

Get the webapp-relative URI for the previous page (in this page flow) shown to the user. The previous page is the one shown before the most recent page.

Note: if the current page flow does not use a `@jpf:forward` with a `return-to="previousPage"` or `return-to="currentPage"` attribute, then this method will always return `null` by default. To enable it in this situation, add the following method to the page flow:

> `protected boolean alwaysTrackPreviousPage()
> {
> return true;
> }
> `

#### Returns

a String that is the URI path for the previous page shown to the user.

Related Topics

``PageFlowController.getPreviousPageInfo()``
``PageFlowController.getCurrentPageInfo()``
``PageFlowController.getPreviousActionInfo()``
``PageFlowController.getPreviousActionURI()``
``PageFlowController.getPreviousForm()``
``PageFlowController.getCurrentForwardPath()``

### getPreviousPageInfo() Method

    public final PreviousPageInfo getPreviousPageInfo()

Get information about the previous page (in this page flow) shown to the user. The previous page is the one shown before the most recent page.

Note: if the current page flow does not use a `@jpf:forward` with a `return-to="previousPage"` or `return-to="currentPage"` attribute, then this method will always return `null` by default. To enable it in this situation, add the following method to the page flow:

> `protected boolean alwaysTrackPreviousPage()
> {
> return true;
> }
> `

#### Returns

a PreviousPageInfo with information about the previous page shown to the user.

Related Topics

``PageFlowController.getCurrentPageInfo()``
``PageFlowController.getPreviousActionInfo()``
``PageFlowController.getPreviousActionURI()``
``PageFlowController.getPreviousForm()``
``PageFlowController.getPreviousForwardPath()``
``PageFlowController.getCurrentForwardPath()``

### getTaxonomy() Method

    protected String getTaxonomy()

Get the "resource taxonomy": a period-separated list that starts with the current web application name, continues through all of this PageFlowController's parent directories, and ends with this PageFlowController's class name.

### getURI() Method

    public String getURI()

Get the URI for addressing this PageFlowController.

#### Returns

a String that is the URI which will execute the begin action on this PageFlowController.

### isNestable() Method

    protected boolean isNestable()

Tell whether this PageFlowController can be "nested", i.e., if it can be invoked from another page flow with the intention of returning to the original one. Page flows are declared to be nested using the `@jpf:controller nested="true"` annotation.

Overrides
  `FlowController.isNestable()`

#### Returns

`true` if this PageFlowController can be nested.

### isPageFlow() Method

    public boolean isPageFlow()

Tell whether this is a PageFlowController.

Overrides
  `FlowController.isPageFlow()`

#### Returns

`true`.

### valueUnbound(HttpSessionBindingEvent) Method

    public void valueUnbound(HttpSessionBindingEvent event)

Callback when this page flow is removed from the user session. Causes `PageFlowController.onDestroy()``` to be called.

Overrides
  `FlowController.valueUnbound(HttpSessionBindingEvent)`