Spring MVC form validation not working

前端 未结 6 2018
日久生厌
日久生厌 2021-01-06 00:27

I am using Spring 4. My form contains the following variables:

@NotNull
@Email
private String email;
@NotNull
private String firstName;
@NotNull
private Stri         


        
6条回答
  •  时光取名叫无心
    2021-01-06 01:09

    I'm not sure whether you have found ways to fix this. I am facing the same issue as well. and I managed to solve it. The problem with my setting is totally manual and I'm doing big mistake by placing the whole hibernate-validator-5.1.3.Final-dist.zip inside lib folder.

    So what I did is I get this 6 files inside "hibernate-validator-5.1.3.Final-dist.zip" in dist folder and place this with web app lib.

    • classmate-1.0.0.jar
    • hibernate-validator-5.1.3.Final.jar
    • javax.el-2.2.4.jar
    • javax.el-api-2.2.4.jar
    • jboss-logging-3.1.3.GA.jar
    • validation-api-1.1.0.Final.jar

    This fixed my issue.

提交回复
热议问题