Java / Spring MVC 3 validation of an email address

后端 未结 4 461
野的像风
野的像风 2021-02-05 05:54

I have a Java backend with Spring MVC and I am using validation in this way on my domain object for an email address:

import javax.validation.constraints.NotNull         


        
4条回答
  •  爱一瞬间的悲伤
    2021-02-05 06:43

    If you use Hibernate Validator you can use @Email annotation Anyway you can create your custom contraint annotation and set a custom message to show in your resource properties file.

提交回复
热议问题