JSR303校验 直接在注入实体类上添加注解,然后在需要校验的属性上加上相关的注解 @Validated //数据校验 public class Person { @Email() private String name; private Integer age; private Boolean happy; private Date birth; private Map<String,Object> maps; private List<Object> lists; private Dog dog; } JSR303所有校验注解: