HTTP Status 500-request processing failed; Nested exception is org.springframework.validation.BindException: Org.springframework.validation.beanpropertybindingresult:3 errors
Org.springframework.web.util.NestedServletException:Request processing failed; Nested exception is org.springframework.validation.BindException: Org.springframework.validation.beanpropertybindingresult:3Errorsfield Error in Object' League ' on Field ' season ': Rejected value []; codes [Notblank.league.season,notblank.season,notblank.java.lang.string,notblank]; arguments [Org.springframework.context.support.DefaultMessageSourceResolvable:codes [League.season,season]; arguments [];defaultmessage [season]];defaultmessage [season cannot be empty]field error in Object' League ' on Field ' year ': Rejected value [NULL]; codes [Notnull.league.year,notnull.year,notnull.java.lang.integer,notnull]; arguments [Org.springframework.context.support.DefaultMessageSourceResolvable:codes [league.year,year]; arguments [];defaultmessage [year]];defaultmessage [year cannot be empty]field error in Object' League ' on field ' title ': Rejected value []; codes [Length.league.title,length.title,length.java.lang.string,length]; arguments [Org.springframework.context.support.DefaultMessageSourceResolvable:codes [League.title,title]; arguments [];defaultmessage [title],20,4];defaultmessage [length should be at 4-between 20 characters] Org.springframework.web.servlet.FrameworkServlet.processRequest (Frameworkservlet.java:894) Org.springframework.web.servlet.FrameworkServlet.doPost (Frameworkservlet.java:789) Javax.servlet.http.HttpServlet.service (Httpservlet.java:647) Javax.servlet.http.HttpServlet.service (Httpservlet.java:728)
The problem is that the method of the Controller class adds a useless parameter: the model. After removing the parameter, it returns to normal. Possible causes:1. due to the field value of the form is not required.
2. The parameters of the method Model,springmvc attempt to encapsulate the parameters in the form as objects, causing an error.
SPRINGMVC errors in the course of use