Spring MVC form validation not working

前端 未结 6 2044
日久生厌
日久生厌 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:03

    i also faced the same issue where my entire code was properly written.

    The problem was the different version of jar files that i was using .

    I had hibernate-validator-cdi- 5.0.7.Final and hibernate-validator-6.0.2.Final.

    Just make sure your jar files are of the same version.

    When i kept all the jars of same version, my issue got resolved. I hope this will help you .

提交回复
热议问题