|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |
@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
.
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 |
---|
public abstract String name
public abstract Jpf.Catch[] catches
Jpf.ExceptionHandler
)
when a particular exception is thrown.
public abstract Jpf.ConditionalForward[] conditionalForwards
true
. The conditions are evaluated in order, so if more than one would evaluate to
true
, the first one wins.
public abstract boolean doValidation
validationErrorForward()
is set while
doValidation
is not, then validation is enabled automatically.
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.
public abstract boolean loginRequired
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
.
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).
public abstract boolean readOnly
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.
public abstract String[] rolesAllowed
NotLoggedInException
will be thrown when the current
LoginHandler
returns null
for
getUserPrincipal
. The default LoginHandler simply calls
getUserPrincipal
on HttpServletRequest
.
UnfulfilledRolesException
will be thrown when the
current LoginHandler
returns
false
from isUserInRole
for each of the roles in the list. The
default LoginHandler simply calls isUserInRole
on
HttpServletRequest
.
public abstract String useFormBean
useFormBeanType()
.
public abstract Class useFormBeanType
useFormBean()
.
public abstract Jpf.ValidatableProperty[] validatableProperties
public abstract Jpf.Forward validationErrorForward
doValidation()
is set to false
. Validation is always
disabled when this value is not set.
public abstract String action
path()
, navigateTo()
,
returnAction()
, tilesDefinition()
, and forwardRef()
.
public abstract boolean externalRedirect
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
.
public abstract Jpf.NavigateTo navigateTo
path()
,
returnAction()
, action()
, tilesDefinition()
, and forwardRef()
.
Jpf.NavigateTo
public abstract Class outputFormBeanType
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.
public abstract String outputFormBean
public abstract String path
navigateTo()
, returnAction()
, action()
,
tilesDefinition()
, and forwardRef()
.
public abstract boolean redirect
true
, there will be a browser redirect (not a server forward) to the destination path.
public abstract boolean restoreQueryString
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.
public abstract String returnAction
path()
,
navigateTo()
, action()
, tilesDefinition()
, and forwardRef()
, and only valid in a
nested page flow (Jpf.Controller.nested()
must be true
).
public abstract String tilesDefinition
Jpf.Controller.tilesDefinitionsConfigs()
. Mutually-exclusive with path()
, navigateTo()
,
returnAction()
, action()
, and forwardRef()
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |