org.springframework.web.servlet.mvc.method.annotation.support
Class ServletModelAttributeMethodProcessor
java.lang.Object
org.springframework.web.method.annotation.support.ModelAttributeMethodProcessor
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
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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.
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 torequest - the current request