JSR303

使用时遇到的问题

javax.validation.UnexpectedTypeException: HV000030: No validator could be found for constraint ‘javax.validation.constraints.Size’ validating type ‘java.lang.Integer’. Check configuration for ‘titleType’

1
2
@Size(min = 1,max = 2,message = "发票抬头类型不正确")
private Integer titleType;

@Size表示集合的数量,而不是数值