1

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

   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;
        }
4

1 回答 1

1

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

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

这里有一些进一步的信息。

于 2012-05-13T21:40:19.067 回答