Some JSR-303 bound by rules and common usage

 JSR303 data check

spring-boot may be used @validated check data, if the data exception thrown will be unified, convenient unitary anomaly centers.

@Component //注册bean
@Validated  //引入数据校验
public class demo {

    @Email //name必须是邮箱格式
    private String email;
}

Published 372 original articles · won praise 89 · Views 230,000 +

Guess you like

Origin blog.csdn.net/sizaif/article/details/104496803