struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Miller" <k...@vardus.com>
Subject Re: An enhancement for <struts:errors>?
Date Thu, 21 Sep 2000 06:53:23 GMT
Even better than that would be to write a <struts:listErrors> tag that would
iterate over the errors.
That way any arbitrary formatting could be applied, on a case-by-case basis
if so desired. Also, it would be nice to remove the HTML from the properties
file - I really don't think it belongs in there.

eg.

<struts:listErrors error="error" count="count">
  <font color="red"><%= error %></font><br>
</struts:listErrrors>
<% if (count > 0) { %>
  <p/>Please correct the above problems before continuing
<% } %>

The above code would problably be put in a separate file and included using
<struts:include>.

What do you think?


----- Original Message -----
From: "Martin Cooper" <martin.cooper@tumbleweed.com>
To: <struts-user@jakarta.apache.org>
Sent: Thursday, September 21, 2000 5:27 AM
Subject: An enhancement for <struts:errors>?


> Right now, if there are multiple error messages to be output by the
> <struts:errors> tag, they will be separated by newlines. This means they
> effectively run together when displayed in an HTML page. Unless I'm
missing
> something, any formatting has to be included within the messages
themselves.
>
> What about extending ErrorsTag to use an errors.format value as well as
> errors.header and errors.footer, where this string would be used with
> MessageFormat? This would allow much more control over the presentation.
For
> example, with the following values:
>
> errors.header="<table>"
> errors.format="<tr><td>{0}</td></tr>"
> errors.footer="</table>"
>
> the errors would be displayed as a table, one row per error message.
>
> --
> Martin Cooper
> Tumbleweed Communications
>
>
>
>


Mime
View raw message