| |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.springframework.validation.DataBinder | +--org.springframework.web.bind.ServletRequestDataBinder
Use this class to perform manual data binding from servlet request parameters to JavaBeans, including support for multipart files.
| Fields inherited from class org.springframework.validation.DataBinder |
MISSING_FIELD_ERROR_CODE |
| Constructor Summary | |
ServletRequestDataBinder(Object target, String name)Create a new DataBinder instance. | |
| Method Summary | |
void | bind(ServletRequest request)Bind the parameters of the given request to this binder's target, also binding multipart files in case of a multipart request. |
void | closeNoCatch()Treats errors as fatal. |
| Methods inherited from class org.springframework.validation.DataBinder |
bind, close, getErrors, registerCustomEditor, registerCustomEditor, setRequiredFields |
| Constructor Detail |
public ServletRequestDataBinder(Object target, String name)
| Method Detail |
public void bind(ServletRequest request)
This call can create field errors, representing basic binding errors like a required field (code "required"), or type mismatch between value and bean property (code "typeMismatch").
Multipart files are bound via their parameter name, just like normal HTTP parameters: i.e. "uploadedFile" to an "uploadedFile" bean property, invoking a "setUploadedFile" setter method.
The type of the target property for a multipart file can be MultipartFile, byte[], or String. The latter two receive the contents of the uploaded file; all metadata like original file name, content type, etc are lost in those cases.
public void closeNoCatch()
throws ServletRequestBindingException
| |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||