blog2.0--jsr303参数校验

引入依赖

<!--jsr303参数校验-->
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-validation</artifactId>
		</dependency>

 

1.在需要进行参数校验的参数前加@Valid

2.在需要校验的属性上加注解@NotNUll,@Length(min=32)

 

posted @ 2018-06-25 21:23  SkyeAngel  阅读(97)  评论(0编辑  收藏  举报