在我的时区下午好。
我正在为一家公司完成一个 Java Web 项目,我需要编写在 actionForm 验证方法中检测到的错误。在 validate 方法中,我以这种方式添加错误(代码片段):
ActionErrors ae = new ActionErrors();
ae.add("dummy",new ActionMessage("message"));
...java...code
ae.add("dummy",new ActionMessage("message"));
在我的jsp中,我想做的是遍历所有发现的错误,然后打印它们。我不想通过以下方式放置所有错误:
<html:errors property="prop1"/>
<html...code/>
<html:errors property="prop2"/>
我想做的是这样的(伪代码):
if(there is errors)
for(erros.hasNext)
<td>errors.next()</td>
如果必须,我可以使用普通的脚本。任何机构可以帮助我听到吗?
提前致谢最好的问候