Converting from String to custom Object for Spring MVC form Data binding?

后端 未结 5 1149
萌比男神i
萌比男神i 2020-11-29 01:19

I am using Spring MVC\'s SimpleFormController in conjunction with Spring MVC\'s form JTL to create a form to edit a Generic object.

On my form I have a drop down whe

5条回答
  •  南笙
    南笙 (楼主)
    2020-11-29 01:43

    I think you are correct. You need to register a custom editor on the binder like you done before so you can convert a String to a Server instance. There is an example of a custom PropertyEditor here in the Spring reference docs that should get you started.

    I agree that the MVC documentation is not the best. I have had to do a lot of Googling and searching on the Spring forums.

提交回复
热议问题