org.springframework.web.servlet.mvc.multiaction
Class ParameterMethodNameResolver
java.lang.Object
org.springframework.web.servlet.mvc.multiaction.ParameterMethodNameResolver
- All Implemented Interfaces:
- MethodNameResolver
- public class ParameterMethodNameResolver
- extends Object
- implements MethodNameResolver
Simple implementation of MethodNameResolver that looks for a
parameter value containing the name of the method to invoke.
The name of the parameter and optionally also the name of a
default handler method can be specified as JavaBean properties.
- Author:
- Rod Johnson, Juergen Hoeller
- See Also:
setParamName(java.lang.String)
,
setDefaultMethodName(java.lang.String)
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT_PARAM_NAME
public static final String DEFAULT_PARAM_NAME
- See Also:
- Constant Field Values
ParameterMethodNameResolver
public ParameterMethodNameResolver()
setParamName
public void setParamName(String paramName)
- Set the parameter name we're looking for.
Default is "action".
setDefaultMethodName
public void setDefaultMethodName(String defaultMethodName)
- Set the name of the default handler method that should be
used when no parameter was found in the request
getHandlerMethodName
public String getHandlerMethodName(HttpServletRequest request)
throws NoSuchRequestHandlingMethodException
- Description copied from interface:
MethodNameResolver
- Return a method name that can handle this request. Such
mappings are typically, but not necessarily, based on URL.
- Specified by:
getHandlerMethodName
in interface MethodNameResolver
- Parameters:
request
- current HTTP request
- Returns:
- a method name that can handle this request.
Never returns null; throws exception if not resolvable.
- Throws:
NoSuchRequestHandlingMethodException
- if no method
can be found for this URL
Copyright (C) 2003-2004 The Spring Framework Project.