SPRINGMVC errors in the course of use

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.