![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
springboot
qq_35527552
这个作者很懒,什么都没留下…
展开
-
SpringBoot 参数校验的方法
SpringBoot 参数校验的方法Introduction有参数传递的地方都少不了参数校验。在web开发中,前端的参数校验是为了用户体验,后端的参数校验是为了安全。试想一下,如果在controller层中没有经过任何校验的参数通过service层、dao层一路来到了数据库就可能导致严重的后果,最好的结果是查不出数据,严重一点就是报错,如果这些没有被校验的参数中包含了恶意代码,那就可能导致更严重的后果。这里我们主要介绍在springboot中的几种参数校验方式。常用的用于参数校验的注解如下:转载 2020-12-30 09:51:16 · 215 阅读 · 0 评论 -
springboot使用validation验证json参数
实体类public class student{ private int sid; @NotBlank private String name; private int age;}controller@Validatedpublic class StudentController { @RequestMapping(value = "/addStudent...原创 2020-04-15 15:25:30 · 1635 阅读 · 0 评论