Good Afternoon in my timezone.
I am finalizing a Java Web project to a company, and i need to write errors detected in the actionForm validation method. Inside the validate method i am adding errors that way (snippet of code):
ActionErrors ae = new ActionErrors();
ae.add("dummy",new ActionMessage("message"));
...java...code
ae.add("dummy",new ActionMessage("message"));
In my jsp what i want to do is iterate over all the errors found it , and print them. i do not want to put all the errors by the following way :
<html:errors property="prop1"/>
<html...code/>
<html:errors property="prop2"/>
What i want to do is something like this (psedo-code):
if(there is errors)
for(erros.hasNext)
<td>errors.next()</td>
I can use normal scriplets if i have to. Can any body help me hear ?
Thanks in advance Best regards
Just use
<html:errors/>
. See http://struts.apache.org/1.2.x/userGuide/struts-html.html#errors for how the tag works:(emphasis mine)