You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Karr, David" <da...@attws.com> on 2002/10/10 20:45:01 UTC

Strategies for iterating through ActionMessages in JSP?

(And yes, I did do searches for this issue, but I didn't find anything
useful, although I did think this had been discussed before.)

It appears to me that the "html:messages" tag is somewhat handicapped, in
comparison to the "html:errors" tag.  The "html:errors" tag can use a
"prefix" and "suffix" for each error.  There appears to be nothing like this
for the "html:messages" tag.  There is a "header" and "footer" for both
tags, which is printed before and after the LIST of errors or messages, but
nothing to put around each message.

It's also curious that the way the "header" and "footer" are defined in
these tags is different.  The "html:errors" tag has a hardcoded resource
name to retrieve the header and footer (and prefix and suffix), but the
"html:messages" tag has "header" and "footer" attributes to specify a key to
use.  I like using the attribute value to specify this, or at least override
it.

Would anyone find it useful if the "html:messages" tag had new attributes
named "prefix" and "suffix", which specified the message keys for the prefix
and suffix for each message?

In addition, it would be nice to add four attributes to "html:errors", being
"header", "footer", "prefix" and "suffix".

Along with this, there would still be the DEFAULT resource key names of
"errors.header", "errors.footer", etcetera, and additional DEFAULT values of
"messages.header", etcetera.

If I'm not completely mistaken about how this works, or what is needed, I'll
submit an enhancement request if other people agree with this.

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>