jstl and struts ActionErrors
843838May 4 2006 — edited May 4 2006I'm working in a project where i'm not allowed to use struts <html:errors> tag. Instead of this i'm granted to use c:foreach
to display errors in my jsp.
On my validate method i got this:
ActionErrors errors = new ActionErrors();
if ((codStatus == null) || (codStatus.length()==0)) {
errors.add(ActionErrors.GLOBAL_MESSAGE,
new ActionMessage("status field is required", false));
}
return errors;
i got no clue about how to iterate over the ActionErrors to display
validation messages. i tried this:
<c:forEach var="error" items="${errors}">
<tr>
<td>values:
<c:forEach var="val" items="${error.key}">
<c:out value="${val}"/>
</c:forEach>
</td>
</tr>
</c:forEach>
but it shows nothing.
Any help would be great...
Regards