You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Nimmons, Buster" <bu...@sbec.com> on 2004/05/11 15:07:13 UTC
using multiple error messages
currently my ApplicationResources.properties file contains the following
errors.header entry
<h3><font color\="red">The following error occurred</font></h3>You must
correct the following error(s) before proceeding\:<ul>
this is fine for application errors. However I would like to define a
different header for System errors so I may such as
<h3><font color\="red">The following unrecoverable error(s) have
occurred</font></h3>It is not possible to proceed. When contacting support
identify the errors below by the error ID listed\:<ul>
How can I specify multiple error headers and tell the <html:error tag to use
the appropriate one
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: using multiple error messages
Posted by Niall Pemberton <ni...@blueyonder.co.uk>.
Anthing you want, it stores each message under a page context attribute
that you name in "id"
<html:messages id="myError" header="errors.systemheader">
<bean:write name="myError"/>
</html:messages>
----- Original Message -----
From: "Nimmons, Buster" <bu...@sbec.com>
To: "'Struts Users Mailing List'" <us...@struts.apache.org>
Sent: Tuesday, May 11, 2004 4:54 PM
Subject: RE: validwhen validation
> what do I specify as the id to iterate over the ActionErrors in the page
> scope
>
----- Original Message -----
From: "Niall Pemberton" <ni...@blueyonder.co.uk>
To: "Struts Users Mailing List" <us...@struts.apache.org>
Sent: Tuesday, May 11, 2004 4:38 PM
Subject: Re: using multiple error messages
> The <html:messages> tag does exactly what you want - you can specify the
> header/footer/suffix/prefix as attributes on the tag:
>
> <html:messages header="errors.systemheader"/>
>
> http://jakarta.apache.org/struts/userGuide/struts-html.html#messages
>
> Niall
>
> ----- Original Message -----
> From: "Nimmons, Buster" <bu...@sbec.com>
> To: <us...@struts.apache.org>
> Sent: Tuesday, May 11, 2004 2:07 PM
> Subject: using multiple error messages
>
>
> > currently my ApplicationResources.properties file contains the following
> > errors.header entry
> >
> > <h3><font color\="red">The following error occurred</font></h3>You must
> > correct the following error(s) before proceeding\:<ul>
> >
> > this is fine for application errors. However I would like to define a
> > different header for System errors so I may such as
> >
> > <h3><font color\="red">The following unrecoverable error(s) have
> > occurred</font></h3>It is not possible to proceed. When contacting
support
> > identify the errors below by the error ID listed\:<ul>
> >
> > How can I specify multiple error headers and tell the <html:error tag to
> use
> > the appropriate one
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: using multiple error messages
Posted by Niall Pemberton <ni...@blueyonder.co.uk>.
The <html:messages> tag does exactly what you want - you can specify the
header/footer/suffix/prefix as attributes on the tag:
<html:messages header="errors.systemheader"/>
http://jakarta.apache.org/struts/userGuide/struts-html.html#messages
Niall
----- Original Message -----
From: "Nimmons, Buster" <bu...@sbec.com>
To: <us...@struts.apache.org>
Sent: Tuesday, May 11, 2004 2:07 PM
Subject: using multiple error messages
> currently my ApplicationResources.properties file contains the following
> errors.header entry
>
> <h3><font color\="red">The following error occurred</font></h3>You must
> correct the following error(s) before proceeding\:<ul>
>
> this is fine for application errors. However I would like to define a
> different header for System errors so I may such as
>
> <h3><font color\="red">The following unrecoverable error(s) have
> occurred</font></h3>It is not possible to proceed. When contacting support
> identify the errors below by the error ID listed\:<ul>
>
> How can I specify multiple error headers and tell the <html:error tag to
use
> the appropriate one
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
RE: using multiple error messages
Posted by Daniel Perry <d....@netcase.co.uk>.
Not sure if there is a better way of doing this, but my suggestion would be
have no error.header entry, and instead have:
error.systemheader
error.applicationerror
with the two entries you gave, and always add one of those to the error list
first.
Daniel.
-----Original Message-----
From: Nimmons, Buster [mailto:bustern@sbec.com]
Sent: 11 May 2004 14:07
To: 'user@struts.apache.org'
Subject: using multiple error messages
currently my ApplicationResources.properties file contains the following
errors.header entry
<h3><font color\="red">The following error occurred</font></h3>You must
correct the following error(s) before proceeding\:<ul>
this is fine for application errors. However I would like to define a
different header for System errors so I may such as
<h3><font color\="red">The following unrecoverable error(s) have
occurred</font></h3>It is not possible to proceed. When contacting support
identify the errors below by the error ID listed\:<ul>
How can I specify multiple error headers and tell the <html:error tag to use
the appropriate one
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org