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
FieldsModifier and TypeFieldDescriptionprotected ActionEventListenerprotected Stringprotected booleanprotected ActionConfigprotected Configurationprotected booleanprotected ActionInvocationprotected LocalizedTextProviderprotected Stringprotected Stringprotected ObjectFactoryprotected UnknownHandlerManager -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDefaultActionProxy(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 StringbooleanGets 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 (meaningexecutewill be invoked).Gets the namespace the ActionConfig for this ActionProxy is mapped to.booleanGets status of the method value's initialization.protected voidprepare()protected StringvoidsetActionEventListener(ActionEventListener listener) voidsetConfiguration(Configuration config) voidsetExecuteResult(boolean executeResult) Sets whether this ActionProxy should also execute the Result after executing the Action.voidsetLocalizedTextProvider(LocalizedTextProvider localizedTextProvider) voidsetObjectFactory(ObjectFactory factory) voidsetUnknownHandler(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:ActionProxyGets the Action instance for this Proxy.- Specified by:
getActionin interfaceActionProxy- Returns:
- the Action instance
-
getActionName
Description copied from interface:ActionProxyGets the alias name this ActionProxy is mapped to.- Specified by:
getActionNamein interfaceActionProxy- Returns:
- the alias name
-
getConfig
Description copied from interface:ActionProxyGets the ActionConfig this ActionProxy is built from.- Specified by:
getConfigin interfaceActionProxy- Returns:
- the ActionConfig
-
setExecuteResult
public void setExecuteResult(boolean executeResult) Description copied from interface:ActionProxySets whether this ActionProxy should also execute the Result after executing the Action.- Specified by:
setExecuteResultin interfaceActionProxy- Parameters:
executeResult- true to also execute the Result.
-
getExecuteResult
public boolean getExecuteResult()Description copied from interface:ActionProxyGets the status of whether the ActionProxy is set to execute the Result after the Action is executed.- Specified by:
getExecuteResultin interfaceActionProxy- Returns:
- the status
-
getInvocation
- Specified by:
getInvocationin interfaceActionProxy
-
getNamespace
Description copied from interface:ActionProxyGets the namespace the ActionConfig for this ActionProxy is mapped to.- Specified by:
getNamespacein interfaceActionProxy- Returns:
- the namespace
-
execute
Description copied from interface:ActionProxyExecute 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:
executein interfaceActionProxy- Returns:
- the result code returned from executing the ActionInvocation
- Throws:
Exception- can be thrown.- See Also:
-
getMethod
Description copied from interface:ActionProxyGets the method name to execute, or null if no method has been specified (meaningexecutewill be invoked).- Specified by:
getMethodin interfaceActionProxy- Returns:
- the method to execute
-
prepare
protected void prepare() -
prepareNotAllowedErrorMessage
-
getErrorMessage
-
isMethodSpecified
public boolean isMethodSpecified()Description copied from interface:ActionProxyGets status of the method value's initialization.- Specified by:
isMethodSpecifiedin interfaceActionProxy- Returns:
- true if the method returned by getMethod() is not a default initializer value.
-