SpringBoot中@Email报错解决

JSR303校验相关
现象:在springboot中使用@Email注解进行数据校验时,报没有该注解的错误。

解决方法:

在pom.xml中加该配置

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>

测试成功


==测试成功==

![img](https://img-blog.csdnimg.cn/img_convert/33ea476321cf56e370e4b3f6f7ddc8e6.png)