我不想在使用struts验证时出现html:error中的项目符号

时间:2012-05-13 21:30:06

标签: java java-ee struts validation

有没有办法从验证错误中删除项目符号。

   public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
            String method = request.getParameter("method");
            ActionErrors errors = new ActionErrors();
            if (method != null) {
                if (method.equals("changepwd")) {
                    if (this.password == null || this.password.length() < 1) {
                        errors.add("password", new ![enter image description here][1]ActionMessage("errors.required","Password"));
                        //TODO: add 'error.name.required' key to your resources
                    } 
                   if (this.cnfpassword == null || this.cnfpassword.length() < 1) {
                        errors.add("cnfpassword", new ActionMessage("errors.required","Confirm Password"));
                        //TODO: add 'error.name.required' key to your resources
                    }
                }
            }
            return errors;
        }

1 个答案:

答案 0 :(得分:1)

使用以下消息键,此处显示默认值(我认为;我不记得):

errors.header=<h3><font color="red">Validation Errors</font></h3><ul>
errors.footer=</ul>
errors.prefix=<li>
errors.suffix=</li>

Here's some further info.