java - Spring MVC Validation error -
i have spring controller accepts 1 of business objects argument, spring automatically building form data. 1 of attributes of object enum comes select dropdown in form. using @valid notation validation on object, using implementation of spring validator interface.
in testing, manually added selection dropdown (using browser inspector) not valid, since can't converted enum. have thought spring leave enum attribute null, , validator catch error, runtime error:
javax.el.elexception: cannot convert cc of type class java.lang.string class com.app.enums.states
any ideas on how handle this?
we need more details on want happen when occurs. tell spring how convert string
instance of states
using converter
(see this page details).
Comments
Post a Comment