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
Constructors -
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 classicexecuteservlet signature from the specified context.protected final MethodresolveClassicMethod(ActionContext context, String methodName) Obtains the method instance with the classicexecuteservlet 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:MethodResolverConstructs the arguments that will be passed to the dispatched method.- Specified by:
buildArgumentsin interfaceMethodResolver- Overrides:
buildArgumentsin classAbstractMethodResolver- Parameters:
context- the current action contextmethod- the target method of this dispatch- Returns:
- the arguments array for the method, or
nullif the method does not match any supported signatures - See Also:
-
buildClassicArguments
Constructs the arguments to invoke the classicexecuteservlet 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 classicexecuteservlet signature.- Parameters:
context- the current contextmethodName- the method name to introspect- Returns:
- the found method in the action
- Throws:
NullPointerException- if context isnullNoSuchMethodException- if the method does not exist- See Also:
-
resolveMethod
Description copied from interface:MethodResolverDecides the appropriate method instance for the specified method name. Implementations may introspect for any desired method signature.- Specified by:
resolveMethodin interfaceMethodResolver- Overrides:
resolveMethodin 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
-