org.apache.beehive.netui.pageflow.annotations
Annotation Type Jpf.SimpleAction


@Target(value=ANNOTATION_TYPE)
@Retention(value=RUNTIME)
public static @interface Jpf.SimpleAction

A "simple" action, which defines its behavior wholly through an annotation, rather than through a method. This is useful when an action does not require any Java code to run (for example, a begin action that simply forwards to a particular page). Actions that do require Java code are built using methods annotated with Jpf.Action.

See Also:
Jpf.Action

Required Element Summary
 String name
          The action name.
 
Optional Element Summary
 String action
          The name of an action to forward to.
 Jpf.Catch[] catches
          Array of declarative catches, which can reroute to a page or to a handler method (Jpf.ExceptionHandler) when a particular exception is thrown.
 Jpf.ConditionalForward[] conditionalForwards
          Array of conditional forwards.
 boolean doValidation
          Enable or disable form validation for this action.
 boolean externalRedirect
          When set to true, then this Forward will redirect to a path that is external to the current webapp; for example, the following path would redirect to /dir/mypage.jsp in webapp "/myapp": path="/myapp/dir/mypage.jsp", externalRedirect=true With externalRedirect set to false, the path above would forward to /myapp/dir/mypage.jsp under the current webapp.
 String forwardRef
           The name of a class-level forward (a Jpf.ConditionalForward in Jpf.Controller.forwards()) which will serve as the destination for this simple action.
 boolean loginRequired
          If set to true, a NotLoggedInException will be thrown for this action when the current LoginHandler returns null for getUserPrincipal.
 Jpf.NavigateTo navigateTo
          A symbolic name for the page/action to which to navigate.
 String outputFormBean
          The name of a member variable whose value will be passed along (to a page or to another action) with this forward.
 Class outputFormBeanType
          The type of form bean that will be passed along (to a page or to another action) with this forward.
 String path
          The forward path.
 boolean preventDoubleSubmit
           Use a session-scoped token to prevent multiple submits to this action.
 boolean readOnly
          If set to true, then by default this action has "promised" that it will not modify member data.
 boolean redirect
          If true, there will be a browser redirect (not a server forward) to the destination path.
 boolean restoreQueryString
          If true, the original URL query string will be restored when the previous page or action is run.
 String returnAction
          The action to be invoked on the calling page flow.
 String[] rolesAllowed
          Array of roles allowed to access this action.
 String tilesDefinition
          A Tiles definition to forward to.
 String useFormBean
          If set, then the form bean for this action method will be the named member variable, rather than a newly-created instance.
 Class useFormBeanType
          The type of form bean to use for this action.
 Jpf.ValidatableProperty[] validatableProperties
          Array of validation rules that are applied to properties on this action's form bean.
 Jpf.Forward validationErrorForward
          The Forward used when form bean validation fails.
 

Element Detail

name

public abstract String name
The action name.

catches

public abstract Jpf.Catch[] catches
Array of declarative catches, which can reroute to a page or to a handler method (Jpf.ExceptionHandler) when a particular exception is thrown.

Default:
{}

conditionalForwards

public abstract Jpf.ConditionalForward[] conditionalForwards
Array of conditional forwards. Each one is triggered by a JSP 2.0-style expression evaluating to true. The conditions are evaluated in order, so if more than one would evaluate to true, the first one wins.

Default:
{}

doValidation

public abstract boolean doValidation
Enable or disable form validation for this action. If validationErrorForward() is set while doValidation is not, then validation is enabled automatically.

Default:
false

forwardRef

public abstract String forwardRef

The name of a class-level forward (a Jpf.ConditionalForward in Jpf.Controller.forwards()) which will serve as the destination for this simple action. Mutually-exclusive with with action(), path(), navigateTo(), returnAction(), and tilesDefinition().

If this simple action handles the return from a nested page flow that was shown in a popup window, then the forwardRef attribute can be set to the special value "_auto". This causes the framework to write out the correct javascript to close the popup window instead of forwarding to another page.

Default:
""

loginRequired

public abstract boolean loginRequired
If set to true, a NotLoggedInException will be thrown for this action when the current LoginHandler returns null for getUserPrincipal. The default LoginHandler simply calls getUserPrincipal on HttpServletRequest.

Default:
false

preventDoubleSubmit

public abstract boolean preventDoubleSubmit

Use a session-scoped token to prevent multiple submits to this action. When the server detects a double submit on the token, a DoubleSubmitException is thrown.

This is a server-side solution that guards against double processing; however, it is still a good idea to supplement this with a client-side solution to prevent double-submits from happening in the first place (an example of this is the disableSecondClick attribute on the NetUI Button tag, which disables the button through JavaScript as soon as it is pressed).

Default:
false

readOnly

public abstract boolean readOnly
If set to true, then by default this action has "promised" that it will not modify member data. In containers that support clustering, this allows the framework to avoid serializing the controller instance for session failover after the action is run. This is a performance optimization; it does not have an effect on the behavior of the action itself.

Default:
false

rolesAllowed

public abstract String[] rolesAllowed
Array of roles allowed to access this action. If this array is non-empty, then two exceptions may be thrown when the action is raised:

Default:
{}

useFormBean

public abstract String useFormBean
If set, then the form bean for this action method will be the named member variable, rather than a newly-created instance. This is referred to as a "flow-scoped form bean". Note that if the member variable is null, it will be set with a new instance of the correct type. Mutually exclusive with useFormBeanType().

Default:
""

useFormBeanType

public abstract Class useFormBeanType
The type of form bean to use for this action. A new instance of the given class will be created when this action is run. Mutually exclusive with useFormBean().

Default:
java.lang.Void.class

validatableProperties

public abstract Jpf.ValidatableProperty[] validatableProperties
Array of validation rules that are applied to properties on this action's form bean.

Default:
{}

validationErrorForward

public abstract Jpf.Forward validationErrorForward
The Forward used when form bean validation fails. Setting this value automatically enables validation for this action method, unless doValidation() is set to false. Validation is always disabled when this value is not set.

Default:
@org.apache.beehive.netui.pageflow.annotations.Jpf.Forward(name="")

action

public abstract String action
The name of an action to forward to. Mutually-exclusive with path(), navigateTo(), returnAction(), tilesDefinition(), and forwardRef().

Default:
""

externalRedirect

public abstract boolean externalRedirect
When set to true, then this Forward will redirect to a path that is external to the current webapp; for example, the following path would redirect to /dir/mypage.jsp in webapp "/myapp":
path="/myapp/dir/mypage.jsp", externalRedirect=true
With externalRedirect set to false, the path above would forward to /myapp/dir/mypage.jsp under the current webapp. Note that externalRedirect=true implies that redirect=true.

Default:
false

navigateTo

public abstract Jpf.NavigateTo navigateTo
A symbolic name for the page/action to which to navigate. Mutually-exclusive with path(), returnAction(), action(), tilesDefinition(), and forwardRef().

See Also:
Jpf.NavigateTo
Default:
currentPage

outputFormBeanType

public abstract Class outputFormBeanType
The type of form bean that will be passed along (to a page or to another action) with this forward. The actual form bean instance is provided on the Forward object that is returned from the action method (Jpf.Action) or the exception handler method (Jpf.ExceptionHandler). If that object has no output form bean, then a new instance of the given type will be created.

Default:
java.lang.Void.class

outputFormBean

public abstract String outputFormBean
The name of a member variable whose value will be passed along (to a page or to another action) with this forward.

Default:
""

path

public abstract String path
The forward path. Mutually-exclusive with navigateTo(), returnAction(), action(), tilesDefinition(), and forwardRef().

Default:
""

redirect

public abstract boolean redirect
If true, there will be a browser redirect (not a server forward) to the destination path.

Default:
false

restoreQueryString

public abstract boolean restoreQueryString
If true, the original URL query string will be restored when the previous page or action is run. Only valid when the navigateTo attribute is used.

Default:
false

returnAction

public abstract String returnAction
The action to be invoked on the calling page flow. Mutually-exclusive with path(), navigateTo(), action(), tilesDefinition(), and forwardRef(), and only valid in a nested page flow (Jpf.Controller.nested() must be true).

Default:
""

tilesDefinition

public abstract String tilesDefinition
A Tiles definition to forward to. The Tiles definition is found in one of the config files specified with Jpf.Controller.tilesDefinitionsConfigs(). Mutually-exclusive with path(), navigateTo(), returnAction(), action(), and forwardRef().

Default:
""