The <html:errors> tag generates output like this:
(errors.header)CR-LF
(message1)CR-LF
(message2)CR-LF
...
(messageN)CR-LF
(errors.footer)CR-LF
where the values in parentheses are keys into the application's properties
file, and message1 through messageN are your error message keys. Since CR-LF
is just whitespace in HTML, you have to either use <li> (or <td>, etc) in
the messages themselves, or put your <html:errors> tag in a fixed-format
block (e.g. <pre>).
Theoretically, you could grab the ActionErrors object from the request
attribute in which it's stored, and iterate over the errors yourself, but
then you have to get into looking the keys up in the right resource bundle,
etc.
If you really want to do something different, then I'm afraid all I can
suggest is taking a look at ErrorsTag.java and perhaps writing your own tag
based on that.
--
Martin Cooper
----- Original Message -----
From: "Phillip Rhodes" <[EMAIL PROTECTED]>
To: "struts-user-jakarta.apache.org" <[EMAIL PROTECTED]>
Sent: Wednesday, March 28, 2001 12:35 PM
Subject: html:errors, how to keep html out of messages?
> I am using the html:errors tag to display my messages, but I find that I
> have to wrap each of my message key values with a <li></li> for them to
> display properly.
>
> Is there a way that as I iterator through my errors, that I could output
> the error message with the <li> tag?
>
> Thanks!
>