Package org.apache.struts2
Class DefaultActionProxy
java.lang.Object
org.apache.struts2.DefaultActionProxy
- All Implemented Interfaces:
Serializable
,ActionProxy
- Direct Known Subclasses:
StrutsActionProxy
The Default ActionProxy implementation
- Since:
- 2005-8-6
- Author:
- Rainer Hermanns, Revised by Henry Hu, tmjee
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprotected ActionEventListener
protected String
protected boolean
protected ActionConfig
protected Configuration
protected boolean
protected ActionInvocation
protected LocalizedTextProvider
protected String
protected String
protected ObjectFactory
protected UnknownHandlerManager
-
Constructor Summary
ModifierConstructorDescriptionprotected
DefaultActionProxy
(ActionInvocation inv, String namespace, String actionName, String methodName, boolean executeResult, boolean cleanupContext) This constructor is private so the builder methods (create*) should be used to create an DefaultActionProxy. -
Method Summary
Modifier and TypeMethodDescriptionexecute()
Execute this ActionProxy.Gets the Action instance for this Proxy.Gets the alias name this ActionProxy is mapped to.Gets the ActionConfig this ActionProxy is built from.protected String
boolean
Gets the status of whether the ActionProxy is set to execute the Result after the Action is executed.Gets the method name to execute, or null if no method has been specified (meaningexecute
will be invoked).Gets the namespace the ActionConfig for this ActionProxy is mapped to.boolean
Gets status of the method value's initialization.protected void
prepare()
protected String
void
setActionEventListener
(ActionEventListener listener) void
setConfiguration
(Configuration config) void
setExecuteResult
(boolean executeResult) Sets whether this ActionProxy should also execute the Result after executing the Action.void
setLocalizedTextProvider
(LocalizedTextProvider localizedTextProvider) void
setObjectFactory
(ObjectFactory factory) void
setUnknownHandler
(UnknownHandlerManager unknownHandlerManager)
-
Field Details
-
configuration
-
config
-
invocation
-
unknownHandlerManager
-
localizedTextProvider
-
actionName
-
namespace
-
method
-
executeResult
protected boolean executeResult -
cleanupContext
protected boolean cleanupContext -
objectFactory
-
actionEventListener
-
-
Constructor Details
-
DefaultActionProxy
protected DefaultActionProxy(ActionInvocation inv, String namespace, String actionName, String methodName, boolean executeResult, boolean cleanupContext) This constructor is private so the builder methods (create*) should be used to create an DefaultActionProxy.The reason for the builder methods is so that you can use a subclass to create your own DefaultActionProxy instance
(like a RMIActionProxy).- Parameters:
inv
- the action invocationnamespace
- the namespaceactionName
- the action namemethodName
- the method nameexecuteResult
- execute resultcleanupContext
- cleanup context
-
-
Method Details
-
setObjectFactory
-
setConfiguration
-
setUnknownHandler
-
setActionEventListener
-
setLocalizedTextProvider
-
getAction
Description copied from interface:ActionProxy
Gets the Action instance for this Proxy.- Specified by:
getAction
in interfaceActionProxy
- Returns:
- the Action instance
-
getActionName
Description copied from interface:ActionProxy
Gets the alias name this ActionProxy is mapped to.- Specified by:
getActionName
in interfaceActionProxy
- Returns:
- the alias name
-
getConfig
Description copied from interface:ActionProxy
Gets the ActionConfig this ActionProxy is built from.- Specified by:
getConfig
in interfaceActionProxy
- Returns:
- the ActionConfig
-
setExecuteResult
public void setExecuteResult(boolean executeResult) Description copied from interface:ActionProxy
Sets whether this ActionProxy should also execute the Result after executing the Action.- Specified by:
setExecuteResult
in interfaceActionProxy
- Parameters:
executeResult
- true to also execute the Result.
-
getExecuteResult
public boolean getExecuteResult()Description copied from interface:ActionProxy
Gets the status of whether the ActionProxy is set to execute the Result after the Action is executed.- Specified by:
getExecuteResult
in interfaceActionProxy
- Returns:
- the status
-
getInvocation
- Specified by:
getInvocation
in interfaceActionProxy
-
getNamespace
Description copied from interface:ActionProxy
Gets the namespace the ActionConfig for this ActionProxy is mapped to.- Specified by:
getNamespace
in interfaceActionProxy
- Returns:
- the namespace
-
execute
Description copied from interface:ActionProxy
Execute this ActionProxy. This will set the ActionContext from the ActionInvocation into the ActionContext ThreadLocal before invoking the ActionInvocation, then set the old ActionContext back into the ThreadLocal.- Specified by:
execute
in interfaceActionProxy
- Returns:
- the result code returned from executing the ActionInvocation
- Throws:
Exception
- can be thrown.- See Also:
-
getMethod
Description copied from interface:ActionProxy
Gets the method name to execute, or null if no method has been specified (meaningexecute
will be invoked).- Specified by:
getMethod
in interfaceActionProxy
- Returns:
- the method to execute
-
prepare
protected void prepare() -
prepareNotAllowedErrorMessage
-
getErrorMessage
-
isMethodSpecified
public boolean isMethodSpecified()Description copied from interface:ActionProxy
Gets status of the method value's initialization.- Specified by:
isMethodSpecified
in interfaceActionProxy
- Returns:
- true if the method returned by getMethod() is not a default initializer value.
-