org.springframework.web.servlet.mvc.multiaction
Class ParameterMethodNameResolver

java.lang.Object
  extended byorg.springframework.web.servlet.mvc.multiaction.ParameterMethodNameResolver
All Implemented Interfaces:
MethodNameResolver

public class ParameterMethodNameResolver
extends java.lang.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)

Constructor Summary
ParameterMethodNameResolver()
           
 
Method Summary
 java.lang.String getHandlerMethodName(javax.servlet.http.HttpServletRequest request)
          Return a method name that can handle this request.
 void setDefaultMethodName(java.lang.String defaultMethodName)
          Set the name of the default handler method that should be used when no parameter was found in the request
 void setParamName(java.lang.String paramName)
          Set the parameter name we're looking for.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParameterMethodNameResolver

public ParameterMethodNameResolver()
Method Detail

setParamName

public void setParamName(java.lang.String paramName)
Set the parameter name we're looking for. Default is "action".


setDefaultMethodName

public void setDefaultMethodName(java.lang.String defaultMethodName)
Set the name of the default handler method that should be used when no parameter was found in the request


getHandlerMethodName

public java.lang.String getHandlerMethodName(javax.servlet.http.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
Returns:
a method name that can handle this request. Never returns null; throws exception
Throws:
NoSuchRequestHandlingMethodException - if no method can be found for this URL


Copyright (C) 2003-2004 The Spring Framework Project.