Package org.apache.struts2.result
Class ActionChainResult
java.lang.Object
org.apache.struts2.result.ActionChainResult
- All Implemented Interfaces:
Serializable
,Result
This result invokes an entire other action, complete with it's own interceptor stack and result.
This result type takes the following parameters:
- actionName (default) - the name of the action that will be chained to
- namespace - used to determine which namespace the Action is in that we're chaining. If namespace is null, this defaults to the current namespace
- method - used to specify another method on target action to be invoked. If null, this defaults to execute method
- skipActions - (optional) the list of comma separated action names for the actions that could be chained to
<package name="public" extends="struts-default"> <!-- Chain creatAccount to login, using the default parameter --> <action name="createAccount" class="..."> <result type="chain">login</result> </action> <action name="login" class="..."> <!-- Chain to another namespace --> <result type="chain"> <param name="actionName">dashboard</param> <param name="namespace">/secure</param> </result> </action> </package> <package name="secure" extends="struts-default" namespace="/secure"> <action name="dashboard" class="..."> <result>dashboard.jsp</result> </action> </package>
- Author:
- Alexandru Popescu
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
The result parameter name to set the name of the action to chain to. -
Constructor Summary
ConstructorsConstructorDescriptionActionChainResult
(String namespace, String actionName, String methodName) ActionChainResult
(String namespace, String actionName, String methodName, String skipActions) -
Method Summary
Modifier and TypeMethodDescriptionboolean
void
execute
(ActionInvocation invocation) Represents a generic interface for all action execution results.static LinkedList<String>
Get the XWork chain history.getProxy()
int
hashCode()
void
setActionName
(String actionName) Set the action name.void
setActionProxyFactory
(ActionProxyFactory actionProxyFactory) void
void
setNamespace
(String namespace) sets the namespace of the Action that we're chaining to.void
setSkipActions
(String actions) Set the list of actions to skip.protected String
translateVariables
(String text)
-
Field Details
-
DEFAULT_PARAM
The result parameter name to set the name of the action to chain to.- See Also:
-
-
Constructor Details
-
ActionChainResult
public ActionChainResult() -
ActionChainResult
-
ActionChainResult
-
-
Method Details
-
setActionProxyFactory
- Parameters:
actionProxyFactory
- the actionProxyFactory to set
-
setActionName
Set the action name.- Parameters:
actionName
- The action name.
-
setNamespace
sets the namespace of the Action that we're chaining to. if namespace is null, this defaults to the current namespace.- Parameters:
namespace
- the name of the namespace we're chaining to
-
setSkipActions
Set the list of actions to skip. To test if an action should not throe an infinite recursion, only the action name is used, not the namespace.- Parameters:
actions
- The list of action name separated by a white space.
-
setMethod
-
getProxy
-
getChainHistory
Get the XWork chain history. The stack is a list ofnamespace/action!method
keys.- Returns:
- the chain history as string list
-
execute
Description copied from interface:Result
Represents a generic interface for all action execution results. Whether that be displaying a webpage, generating an email, sending a JMS message, etc. -
translateVariables
-
equals
-
hashCode
public int hashCode()
-