Class ServletModelAttributeMethodProcessor

  extended by
      extended by
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.

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
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


public ServletModelAttributeMethodProcessor(boolean useDefaultResolution)
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


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.

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