Class ServletEventMappingDispatcher
java.lang.Object
org.apache.struts.dispatcher.AbstractDispatcher
org.apache.struts.dispatcher.AbstractMappingDispatcher
org.apache.struts.dispatcher.AbstractEventMappingDispatcher
org.apache.struts.dispatcher.servlet.ServletEventMappingDispatcher
- All Implemented Interfaces:
Serializable
,Dispatcher
This servlet-based dispatcher chooses the target method based on the
parameter
attribute of the ActionMapping
that matches
a submission parameter. This is useful for developers who prefer to use many
submit buttons, images, or submit links on a single form and whose related
actions exist in a single action.
To configure the use of this action in your configuration, create an entry like this:
<action path="/saveSubscription"
type="org.example.SubscriptionAction"
dispatcher="org.apache.struts.dispatcher.servlet.ServletEventMappingDispatcher"/>
parameter="save,back,recalc=recalculate,default=save"/>
name="subscriptionForm"
scope="request"
input="/subscription.jsp"
where parameter
contains three possible methods and one
default method if nothing matches (such as the user pressing the enter key).- Since:
- Struts 1.4
- Version:
- $Rev$
- See Also:
-
Field Summary
Fields inherited from class org.apache.struts.dispatcher.AbstractEventMappingDispatcher
DEFAULT_METHOD_KEY
Fields inherited from class org.apache.struts.dispatcher.AbstractDispatcher
CANCELLED_METHOD_NAME, EXECUTE_METHOD_NAME
-
Constructor Summary
ConstructorDescriptionConstructs a new servlet event mapping dispatcher. -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
isSubmissionParameter
(ActionContext context, String methodKey) If the method key exists as a standalone parameter or with the image suffixes (.x/.y), the method name has been found.Methods inherited from class org.apache.struts.dispatcher.AbstractEventMappingDispatcher
resolveMethodName
Methods inherited from class org.apache.struts.dispatcher.AbstractMappingDispatcher
getDefaultMappingParameter, setDefaultMappingParameter
Methods inherited from class org.apache.struts.dispatcher.AbstractDispatcher
dispatch, dispatchMethod, getDefaultMethodName, getMethod, invoke, isCancelled, unspecified
-
Constructor Details
-
ServletEventMappingDispatcher
public ServletEventMappingDispatcher()Constructs a new servlet event mapping dispatcher.
-
-
Method Details
-
isSubmissionParameter
If the method key exists as a standalone parameter or with the image suffixes (.x/.y), the method name has been found.- Specified by:
isSubmissionParameter
in classAbstractEventMappingDispatcher
- Parameters:
context
- the current action contextmethodKey
- the method key- Returns:
true
if match; otherwisefalse
- See Also:
-