blog2.0--jsr303参数校验

引入依赖

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

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

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

原文地址:https://www.cnblogs.com/SkyeAngel/p/9226356.html