org.springframework.web.servlet.mvc.method.annotation.support
Class ServletModelAttributeMethodProcessor

java.lang.Object
  extended by org.springframework.web.method.annotation.support.ModelAttributeMethodProcessor
      extended by org.springframework.web.servlet.mvc.method.annotation.support.ServletModelAttributeMethodProcessor
All Implemented Interfaces:
HandlerMethodArgumentResolver, HandlerMethodReturnValueHandler

public class ServletModelAttributeMethodProcessor
extends ModelAttributeMethodProcessor

A Servlet-specific ModelAttributeMethodProcessor variant that casts the WebDataBinder instance to ServletRequestDataBinder prior to invoking data binding.

Since:
3.1
Author:
Rossen Stoyanchev

Constructor Summary
ServletModelAttributeMethodProcessor(boolean useDefaultResolution)
           
 
Method Summary
protected  void doBind(WebDataBinder binder, NativeWebRequest request)
          Bind the request to the target object contained in the provided binder instance.
 
Methods inherited from class org.springframework.web.method.annotation.support.ModelAttributeMethodProcessor
failOnError, handleReturnValue, resolveArgument, shouldValidate, supportsParameter, supportsReturnType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServletModelAttributeMethodProcessor

public ServletModelAttributeMethodProcessor(boolean useDefaultResolution)
Parameters:
useDefaultResolution - in default resolution mode a method argument that isn't a simple type, as defined in BeanUtils.isSimpleProperty(Class), is treated as a model attribute even if it doesn't have an @ModelAttribute annotation with its name derived from the model attribute type.
Method Detail

doBind

protected void doBind(WebDataBinder binder,
                      NativeWebRequest request)
Bind the request to the target object contained in the provided binder instance.

This method downcasts the binder instance to ServletRequestDataBinder and invokes its bind method passing a ServletRequest to it.

Overrides:
doBind in class ModelAttributeMethodProcessor
Parameters:
binder - the binder with the target object to apply request values to
request - the current request