public
classServletRequestDataBinder
extends WebDataBinder
Overview
Inheritance
Members
Usage
Source
Books
SinceNot specified.
VersionNot specified.
Author(s)Rod Johnson, Juergen Hoeller
Special DataBinder to perform data binding from servlet request parameters
to JavaBeans, including support for multipart files.
See the DataBinder/WebDataBinder superclasses for customization options,
which include specifying allowed/required fields, and registering custom
property editors.
Used by Spring web MVC's BaseCommandController and MultiActionController.
Note that BaseCommandController and its subclasses allow for easy customization
of the binder instances that they use through overriding initBinder.
Can also be used for manual data binding in custom web controllers:
for example, in a plain Controller implementation or in a MultiActionController
handler method. Simply instantiate a ServletRequestDataBinder for each binding
process, and invoke bind with the current ServletRequest as argument:
MyBean myBean = new MyBean();
// apply binder to custom target object
ServletRequestDataBinder binder = new ServletRequestDataBinder(myBean);
// register custom editors, if desired
binder.registerCustomEditor(...);
// trigger actual binding of request parameters
binder.bind(request);
// optionally evaluate binding errors
Errors errors = binder.getErrors();
...
See the DataBinder/WebDataBinder superclasses for customization options, which include specifying allowed/required fields, and registering custom property editors.
Used by Spring web MVC's BaseCommandController and MultiActionController. Note that BaseCommandController and its subclasses allow for easy customization of the binder instances that they use through overriding
initBinder.Can also be used for manual data binding in custom web controllers: for example, in a plain Controller implementation or in a MultiActionController handler method. Simply instantiate a ServletRequestDataBinder for each binding process, and invoke
bindwith the current ServletRequest as argument: