springboot系列-集成JSR-303校验

起点

当你要处理一个应用程序的业务逻辑,数据校验是你必须要考虑和面对的事情。
应用程序必须通过某种手段来确保输入进来的数据从语义上来讲是正确的

具体参考

https://developer.ibm.com/zh/articles/j-lo-jsr303/

使用

1 导入启动器

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

2 类中加注解

参:https://blog.csdn.net/lijiajun_blog/article/details/95879825

posted @ 2020-08-13 14:41  #Kouch  阅读(401)  评论(0)    收藏  举报