Hi,
Currently ActionErrors class has method "get" returning the iterator of all
the errors. Unfortunately, as far as I know you can't use this feature
directly with <logic:iterate> tag as it the method name is not
JavaBeans-like (getXXX).
The only way I found today to use ActionErrors with <logic:iterate> is:
<bean:define id="errors"
name="<%=org.apache.struts.action.Action.ERROR_KEY%>"
type="org.apache.struts.action.ActionErrors"/>
<strong>The following error(s) occured:</strong>
<ul>
<logic:iterate collection="<%=errors.get()%>"
id="error"
type="org.apache.struts.action.ActionError">
<li><bean:message key="<%=error.getKey()%>"/></li>
</logic:iterate>
</ul>
Why not to change the method name from "get" to something like "getErrors"?
The the code above
would look like:
<strong>The following error(s) occured:</strong>
<ul>
<logic:iterate name="<%=org.apache.struts.action.Action.ERROR_KEY%>"
property="errors"
id="error"
type="org.apache.struts.action.ActionError">
<li><bean:message key="<%=error.getKey()%>"/></li>
</logic:iterate>
</ul>
Or maybe did I missed something?
Best Regards,
Slawek
************************************
SLAWEK ZACHCIAL
Hewlett-Packard France
Software Application Engineer
tel: +33 4 76 14 50 44
fax: +33 4 76 14 14 65
TN: 779-5044
************************************