adi*_*tya 1 java validation spring hibernate spring-mvc
这是我在模型课中做的事情
private Integer height;
@NotBlank
@Length(min = 2, max = 3)
public Integer getHeight() {
return height;
}
public void setHeight(Integer height) {
this.height = height;
}
Run Code Online (Sandbox Code Playgroud)
但是在运行时jsp页面中存在验证错误,它表示无法验证整数值.
在message.properties文件中
NotBlank.modelClassName.height =以厘米为单位.Length.modelClassName.height = min {0} max(1).typeMismatch.modelClassName.height =仅限数字.
请帮帮我
| 归档时间: |
|
| 查看次数: |
493 次 |
| 最近记录: |