Package org.apache.struts2.factory
Class PrefixBasedActionProxyFactory
java.lang.Object
org.apache.struts2.DefaultActionProxyFactory
org.apache.struts2.factory.StrutsActionProxyFactory
org.apache.struts2.factory.PrefixBasedActionProxyFactory
- All Implemented Interfaces:
ActionProxyFactory,Initializable
public class PrefixBasedActionProxyFactory
extends StrutsActionProxyFactory
implements Initializable
Prefix based factory should be used with PrefixBasedActionMapper
to use appropriate ActionProxyFactory connected with given
ActionMapper
Add below entry to struts.xml to enable the factory:
<constant name="struts.actionProxyFactory" value="prefix"/>
The factory will use the same set of patterns as defined with:
<constant name="struts.mapper.prefixMapping" value="..."/>
-
Field Summary
Fields inherited from class org.apache.struts2.DefaultActionProxyFactory
container -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateActionProxy(String namespace, String actionName, String methodName, Map<String, Object> extraContext, boolean executeResult, boolean cleanupContext) Creates anActionProxyfor the given namespace and action name by looking up the configuration.The ActionProxy should be fully initialized when it is returned, including having anActionInvocationinstance associated.voidinit()Use this method to initialise your bean, the whole dependency graph was already builtvoidMethods inherited from class org.apache.struts2.factory.StrutsActionProxyFactory
createActionProxyMethods inherited from class org.apache.struts2.DefaultActionProxyFactory
createActionInvocation, createActionProxy, createActionProxy, createActionProxy, createActionProxy, setContainer, toString
-
Constructor Details
-
PrefixBasedActionProxyFactory
public PrefixBasedActionProxyFactory()
-
-
Method Details
-
setPrefixBasedActionProxyFactories
-
init
public void init()Description copied from interface:InitializableUse this method to initialise your bean, the whole dependency graph was already built- Specified by:
initin interfaceInitializable
-
createActionProxy
public ActionProxy createActionProxy(String namespace, String actionName, String methodName, Map<String, Object> extraContext, boolean executeResult, boolean cleanupContext) Description copied from interface:ActionProxyFactoryCreates anActionProxyfor the given namespace and action name by looking up the configuration.The ActionProxy should be fully initialized when it is returned, including having anActionInvocationinstance associated.- Specified by:
createActionProxyin interfaceActionProxyFactory- Overrides:
createActionProxyin classDefaultActionProxyFactory- Parameters:
namespace- the namespace of the action, can be nullactionName- the name of the actionmethodName- the name of the method to executeextraContext- a Map of extra parameters to be provided to the ActionProxy, can be nullexecuteResult- flag which tells whether the result should be executed after the actioncleanupContext- flag which tells whether the original context should be preserved during execution of the proxy.- Returns:
- ActionProxy the created action proxy
-