Class ServletMethodResolver
java.lang.Object
org.apache.struts.dispatcher.AbstractMethodResolver
org.apache.struts.dispatcher.servlet.ServletMethodResolver
- All Implemented Interfaces:
Serializable
,MethodResolver
This class helps resolve methods with servlet-based signatures. The following
examples illustrate the method signatures supported:
return_type execute()
return_type execute(ActionContext context)
return_type execute(ServletActionContext context)
return_type execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
- Since:
- Struts 1.4
- Version:
- $Rev$
- See Also:
-
Field Summary
Fields inherited from class org.apache.struts.dispatcher.AbstractMethodResolver
EMPTY_ARGUMENT_TYPES, EMPTY_ARGUMENTS
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionObject[]
buildArguments
(ActionContext context, Method method) Constructs the arguments that will be passed to the dispatched method.protected final Object[]
Constructs the arguments to invoke the classicexecute
servlet signature from the specified context.protected final Method
resolveClassicMethod
(ActionContext context, String methodName) Obtains the method instance with the classicexecute
servlet signature.resolveMethod
(ActionContext context, String methodName) Decides the appropriate method instance for the specified method name.
-
Constructor Details
-
ServletMethodResolver
public ServletMethodResolver()
-
-
Method Details
-
buildArguments
Description copied from interface:MethodResolver
Constructs the arguments that will be passed to the dispatched method.- Specified by:
buildArguments
in interfaceMethodResolver
- Overrides:
buildArguments
in classAbstractMethodResolver
- Parameters:
context
- the current action contextmethod
- the target method of this dispatch- Returns:
- the arguments array for the method, or
null
if the method does not match any supported signatures - See Also:
-
buildClassicArguments
Constructs the arguments to invoke the classicexecute
servlet signature from the specified context.- Parameters:
context
- the current context- Returns:
- the arguments array
- Throws:
NullPointerException
- if context isnull
- See Also:
-
resolveClassicMethod
protected final Method resolveClassicMethod(ActionContext context, String methodName) throws NoSuchMethodException Obtains the method instance with the classicexecute
servlet signature.- Parameters:
context
- the current contextmethodName
- the method name to introspect- Returns:
- the found method in the action
- Throws:
NullPointerException
- if context isnull
NoSuchMethodException
- if the method does not exist- See Also:
-
resolveMethod
Description copied from interface:MethodResolver
Decides the appropriate method instance for the specified method name. Implementations may introspect for any desired method signature.- Specified by:
resolveMethod
in interfaceMethodResolver
- Overrides:
resolveMethod
in classAbstractMethodResolver
- Parameters:
context
- the current action contextmethodName
- the method name to use for introspection- Returns:
- the method to invoke
- Throws:
NoSuchMethodException
- if an appropriate method cannot be found
-