about java spring mvc framework
what is the use of formbacking object and initbinder of spring frame开发者_Python百科work.
Perhaps this will help you: Spring MVC, generating a form backing object from a request?
In the formbacking (often uses in Spring 2.x SimpleFormController) is used to provide an object, that is filled with the data from the http request.
This was/is needed if the Command object is to complex to be created only out of the information from the request.
For example if the Command object has not public default constructor, or contains sub elements only specified by there interface (so it is impossible to create a concrete object for them automatically)
InitBinder lets you define your own editors and validators for your backing object. For example you can convert different value.
For more information: go here section 15.3.2.12 Customizing WebDataBinder initialization
精彩评论