7-27

jsp里:

<link href="css/common.css" rel="stylesheet">

<td><form:input path="amount" cssClass="form-control" cssErrorClass="form-control error" ></form:input></td>

 <a href="initCharge" class="btn btn-danger">取 消</a>

不为空的验证:

@NotEmpty(field="",  message="{errors.required}")

Controller里:

if (results.hasErrors()) {

log.info("内容验证出错");

    model.addAttribute("chargeForm", chargeForm);

return "manager/charge/addCharge";

}


你可能感兴趣的:(7-27)