当我尝试通过Spring Validator 验证隐藏字段是否为空时,验证器发送的消息被隐藏到 !! 但是我想展示它。这是隐藏字段:
<form:errors path="cinn" Class="errorblock"/>
<input type="hidden" value="${agact.cinn}" name="cinn" />
返回消息的验证器的方法:
public void validate(Object obj, Errors err) {
ValidationUtils.rejectIfEmptyOrWhitespace(err, "cinn", "name.required","You have to choose an agent first");
}
任何想法 ?