@NotBlank注解不起作用

No validator could be found for constraint ‘javax.validation.constraints.NotBlank’ validating type ‘java.lang.String’. Check configuration for ‘oldPassword’"

添加以下两个依赖,缺一不可

	<dependency>
		<groupId>javax.validation</groupId>
		<artifactId>validation-api</artifactId>
		<version>2.0.1.Final</version>
	</dependency>
	<dependency>
		<groupId>org.hibernate</groupId>
		<artifactId>hibernate-validator</artifactId>
		<version>6.0.13.Final</version>
	</dependency>
上一篇:springboot(11)使用SpringBoot validator进行数据验证


下一篇:Springmvc的服务端数据验证-----Hibernate Validator