uk.co.lakesidetech.springframework.web.servlet.mvc.multiaction
Class SubmitParameterPropertiesMethodNameResolver

java.lang.Object
  extended byuk.co.lakesidetech.springframework.web.servlet.mvc.multiaction.SubmitParameterPropertiesMethodNameResolver
All Implemented Interfaces:
org.springframework.web.servlet.mvc.multiaction.MethodNameResolver

public class SubmitParameterPropertiesMethodNameResolver
extends java.lang.Object
implements org.springframework.web.servlet.mvc.multiaction.MethodNameResolver

The SubmitParameterPropertiesMethodNameResolver trys to resolve the method name to called based on the value of the submit parameter used in the form submission. This trysWebUtils.hasSubmitParameter() on all mappings in an attempt to find a method name. If no submit parameter mapping can be found it will default to the set defaultMethodName

example configuration:

Author:
Stuart Eccles

Constructor Summary
SubmitParameterPropertiesMethodNameResolver()
           
 
Method Summary
 void afterPropertiesSet()
          validate required properties
 java.lang.String getHandlerMethodName(javax.servlet.http.HttpServletRequest request)
          Evaluate the method name to resolve for the request
 void setDefaultMethodName(java.lang.String defaultMethodName)
           
 void setMappings(java.util.Properties mappings)
          Set URL to method name mappings from a Properties object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SubmitParameterPropertiesMethodNameResolver

public SubmitParameterPropertiesMethodNameResolver()
Method Detail

setMappings

public void setMappings(java.util.Properties mappings)
Set URL to method name mappings from a Properties object.

Parameters:
mappings - properties with URL as key and method name as value

setDefaultMethodName

public void setDefaultMethodName(java.lang.String defaultMethodName)
Parameters:
defaultMethodName - The defaultMethodName to set.

afterPropertiesSet

public void afterPropertiesSet()
validate required properties


getHandlerMethodName

public java.lang.String getHandlerMethodName(javax.servlet.http.HttpServletRequest request)
                                      throws org.springframework.web.servlet.mvc.multiaction.NoSuchRequestHandlingMethodException
Evaluate the method name to resolve for the request

Specified by:
getHandlerMethodName in interface org.springframework.web.servlet.mvc.multiaction.MethodNameResolver
Parameters:
request - the request object
Returns:
the resolved method name
Throws:
org.springframework.web.servlet.mvc.multiaction.NoSuchRequestHandlingMethodException
See Also:
MethodNameResolver.getHandlerMethodName(javax.servlet.http.HttpServletRequest)