Package org.apache.struts.dispatcher
Class AbstractMappingDispatcher
java.lang.Object
org.apache.struts.dispatcher.AbstractDispatcher
org.apache.struts.dispatcher.AbstractMappingDispatcher
- All Implemented Interfaces:
Serializable
,Dispatcher
- Direct Known Subclasses:
AbstractEventMappingDispatcher
,ServletMappingDispatcher
This abstract class is a template for choosing the target method that is
named by the
parameter
attribute of the corresponding
ActionMapping
. The attribute value, if not provided, defaults to
execute
.- Since:
- Struts 1.4
- Version:
- $Rev$
- See Also:
-
Field Summary
Fields inherited from class org.apache.struts.dispatcher.AbstractDispatcher
CANCELLED_METHOD_NAME, EXECUTE_METHOD_NAME
-
Constructor Summary
ConstructorDescriptionAbstractMappingDispatcher
(MethodResolver methodResolver) Constructs a new dispatcher with the specified method resolver. -
Method Summary
Modifier and TypeMethodDescriptionprotected final String
Retrieves the default mapping parameter value.protected String
resolveMethodName
(ActionContext context) Resolves the method name by obtaining theparameter
attribute from theActionMapping
.protected final void
setDefaultMappingParameter
(String defaultMappingParameter) Stores the new default mapping parameter value.Methods inherited from class org.apache.struts.dispatcher.AbstractDispatcher
dispatch, dispatchMethod, getDefaultMethodName, getMethod, invoke, isCancelled, unspecified
-
Constructor Details
-
AbstractMappingDispatcher
Constructs a new dispatcher with the specified method resolver.- Parameters:
methodResolver
- the method resolver
-
-
Method Details
-
getDefaultMappingParameter
Retrieves the default mapping parameter value. This value is used byresolveMethodName(ActionContext)
if the mapping did not provide a value.- Returns:
- the mapping parameter value or
null
- See Also:
-
resolveMethodName
Resolves the method name by obtaining theparameter
attribute from theActionMapping
.- Parameters:
context
- the current action context- Returns:
- the parameter attribute value
- Throws:
IllegalStateException
- if the parameter cannot be resolved
-
setDefaultMappingParameter
Stores the new default mapping parameter value.- Parameters:
defaultMappingParameter
- the parameter value- See Also:
-