I see that the ActionErrors object is stored as a request attribute under the key "org.apache.struts.action.ERROR".

I would like to set a different CSS class for each <td> containing a field that has a property that is keyed in the ActionErrors instance. In pseudocode:

begin "username" field;
if (ActionErrors instance exists and ActionErrors instance contains any ActionErrors for the "username" property) {
open td with class set to "style B";
print prompt for username field;
print username field;
close td;
}
else {
open td with class set to "style A";
print prompt for username field;
print username field;
close td;
}


. . . and so on, for each field. This seemingly could get to be a lot of code. Any Struts/JSTL tag tricks I can use?


Thanks, Erik




Erik Weber wrote:

In a JSP containing a form, what is the easiest way to see if a form validation error message exists for a particular, say, html:text field, when that page is processing after form validation has failed? For example, what if you wanted to present the messages field by field instead of all together at the top of the page? I assume the error messages are keyed according to the value of the "property" attribute for each field, or something similar?

Thanks,
Erik

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to