validate 生效后,出错
404错误
@Override public void validate() { // TODO Auto-generated method stub if("".equals(user.getUsername().trim())){ this.addFieldError("usernameError", "用户名不能为空"); } if(user.getPassword().length()<6){ this.addFieldError("passwordError", "密码长度不少于6位"); } }
<div> <!-- 显示表单验证的出错信息 --> <s:fielderror/> </div>