gpt4 book ai didi

java - 我不想在 html :errors while using struts validation 中添加项目符号

转载 作者:太空宇宙 更新时间:2023-11-04 08:15:01 24 4
gpt4 key购买 nike

有什么可能的方法可以从验证错误中删除项目符号。

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

最佳答案

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

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.

关于java - 我不想在 html :errors while using struts validation 中添加项目符号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10575409/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com