You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Eddie Fung <ig...@netspace.net.au> on 2002/02/20 12:07:56 UTC

Error Messages and tags

We have the text for error messages declared in the 
ApplicationResources.properties file as per standard. We have the header 
and footer text as required. Now is it possible to display the error 
messages WITHOUT the header and footer in certain situations ? We'd like to 
re-use the messages and display them on the page without the header and 
footer on a couple of pages. In one case the message is actually a warning 
rather than error and to have the standard header (which indicates an 
error) is a bit misleading.

TIA

Eddie 


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


Re: Error Messages and tags

Posted by Eddie Fung <ig...@netspace.net.au>.
Thanks for this ! I've decided to use the Message Tag..

Cheers

eddie
==============
At 01:00 AM 21/02/2002, you wrote:
>1 - I do mean use ApplicationResources. You can look a message up from an
>Action as desribed here:-
>http://www.mail-archive.com/struts-user@jakarta.apache.org/msg21986.html
>Then use
><logic:present name="warningMessage" scope="request">
>    <font color="blue" size="+1">Your request has been accepted but with the
>following warning</font>
>   <bean:write name="warningMessage" scope="request" />
></logic:present>
>to display it.
>
>With similar but more code you can set up an ArrayList or TreeMap(?) of
>messages.
>
>2 - Order is preserved in the later version of Struts. Not sure when it
>changed. but must be diff. from release version & the nightly builds. So now
>you can have in ApplicationResources.properties an 'error'
>common.warning.header=<font color="blue" size="+1">Your request has been
>accepted but with the following warning()s</font>
>& add that before you add your message(s) to ActionErrrors.
>
>Personally I hate this sort of thing! In the world of business software
>functionality is worth spending money on not flashness (often not always).
>
>I'd say do it with just 1 message or use the new Messages tag.


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


Re: Error Messages and tags

Posted by Keith <ke...@yahoo.com>.
1 - I do mean use ApplicationResources. You can look a message up from an
Action as desribed here:-
http://www.mail-archive.com/struts-user@jakarta.apache.org/msg21986.html
Then use
<logic:present name="warningMessage" scope="request">
   <font color="blue" size="+1">Your request has been accepted but with the
following warning</font>
  <bean:write name="warningMessage" scope="request" />
</logic:present>
to display it.

With similar but more code you can set up an ArrayList or TreeMap(?) of
messages.

2 - Order is preserved in the later version of Struts. Not sure when it
changed. but must be diff. from release version & the nightly builds. So now
you can have in ApplicationResources.properties an 'error'
common.warning.header=<font color="blue" size="+1">Your request has been
accepted but with the following warning()s</font>
& add that before you add your message(s) to ActionErrrors.

Personally I hate this sort of thing! In the world of business software
functionality is worth spending money on not flashness (often not always).

I'd say do it with just 1 message or use the new Messages tag.



--- Eddie Fung <ig...@netspace.net.au> wrote:
> Keith,
> 
> not sure what you mean here re:
> 
> 1- Do you mean don't bother using the ApplicationResources.properties and 
> just return a String if we want only a single message ?
> 2- Can you explain how to set a special string for the 1st and last message 
> ? The errors I have are coming out in FIFO order at the moment (order SEEMS 
> to be preserved) . Only with each message preceded by the header and 
> followed by a footer..
> 
> Eddie
> ===============================================
> At 10:19 PM 20/02/2002, Keith wrote:
> >1 - There is a new Messages tag in the nightly build. If you only need 1 
> >mesage
> >it's easy to code it yourself.
> >2 - Don't do this - Use a blank string for header/footer & add your errors 
> >with
> >a wrapper class that adds a special string for the 1st & last message. The
> >order of the errors is not preserved (in this release of struts) so you're
> >header might come out last.
> >
> >--- Eddie Fung <ig...@netspace.net.au> wrote:
> > > We have the text for error messages declared in the
> > > ApplicationResources.properties file as per standard. We have the header
> > > and footer text as required. Now is it possible to display the error
> > > messages WITHOUT the header and footer in certain situations ? We'd 
> > like to
> > > re-use the messages and display them on the page without the header and
> > > footer on a couple of pages. In one case the message is actually a
> warning
> > > rather than error and to have the standard header (which indicates an
> > > error) is a bit misleading.
> > >
> > > TIA
> > >
> > > Eddie
> > >
> > >
> > > --
> > > To unsubscribe, 
> > e-mail:   <ma...@jakarta.apache.org>
> > > For additional commands, e-mail: 
> > <ma...@jakarta.apache.org>
> > >
> >
> >
> >=====
> >~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >Search the archive:-
> >http://www.mail-archive.com/struts-user%40jakarta.apache.org/
> >~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >Keith Bacon - Looking for struts work - South-East UK.
> >phone UK 07960 011275
> >
> >__________________________________________________
> >Do You Yahoo!?
> >Yahoo! Sports - Coverage of the 2002 Olympic Games
> >http://sports.yahoo.com
> >
> >--
> >To unsubscribe, e-mail:  
> <ma...@jakarta.apache.org>
> >For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 


=====
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Search the archive:-
http://www.mail-archive.com/struts-user%40jakarta.apache.org/
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Keith Bacon - Looking for struts work - South-East UK.
phone UK 07960 011275

__________________________________________________
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
http://sports.yahoo.com

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


Re: Error Messages and tags

Posted by Eddie Fung <ig...@netspace.net.au>.
Keith,

not sure what you mean here re:

1- Do you mean don't bother using the ApplicationResources.properties and 
just return a String if we want only a single message ?
2- Can you explain how to set a special string for the 1st and last message 
? The errors I have are coming out in FIFO order at the moment (order SEEMS 
to be preserved) . Only with each message preceded by the header and 
followed by a footer..

Eddie
===============================================
At 10:19 PM 20/02/2002, Keith wrote:
>1 - There is a new Messages tag in the nightly build. If you only need 1 
>mesage
>it's easy to code it yourself.
>2 - Don't do this - Use a blank string for header/footer & add your errors 
>with
>a wrapper class that adds a special string for the 1st & last message. The
>order of the errors is not preserved (in this release of struts) so you're
>header might come out last.
>
>--- Eddie Fung <ig...@netspace.net.au> wrote:
> > We have the text for error messages declared in the
> > ApplicationResources.properties file as per standard. We have the header
> > and footer text as required. Now is it possible to display the error
> > messages WITHOUT the header and footer in certain situations ? We'd 
> like to
> > re-use the messages and display them on the page without the header and
> > footer on a couple of pages. In one case the message is actually a warning
> > rather than error and to have the standard header (which indicates an
> > error) is a bit misleading.
> >
> > TIA
> >
> > Eddie
> >
> >
> > --
> > To unsubscribe, 
> e-mail:   <ma...@jakarta.apache.org>
> > For additional commands, e-mail: 
> <ma...@jakarta.apache.org>
> >
>
>
>=====
>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>Search the archive:-
>http://www.mail-archive.com/struts-user%40jakarta.apache.org/
>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>Keith Bacon - Looking for struts work - South-East UK.
>phone UK 07960 011275
>
>__________________________________________________
>Do You Yahoo!?
>Yahoo! Sports - Coverage of the 2002 Olympic Games
>http://sports.yahoo.com
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>


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


Re: Error Messages and tags

Posted by Keith <ke...@yahoo.com>.
1 - There is a new Messages tag in the nightly build. If you only need 1 mesage
it's easy to code it yourself.
2 - Don't do this - Use a blank string for header/footer & add your errors with
a wrapper class that adds a special string for the 1st & last message. The
order of the errors is not preserved (in this release of struts) so you're
header might come out last.

--- Eddie Fung <ig...@netspace.net.au> wrote:
> We have the text for error messages declared in the 
> ApplicationResources.properties file as per standard. We have the header 
> and footer text as required. Now is it possible to display the error 
> messages WITHOUT the header and footer in certain situations ? We'd like to 
> re-use the messages and display them on the page without the header and 
> footer on a couple of pages. In one case the message is actually a warning 
> rather than error and to have the standard header (which indicates an 
> error) is a bit misleading.
> 
> TIA
> 
> Eddie 
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 


=====
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Search the archive:-
http://www.mail-archive.com/struts-user%40jakarta.apache.org/
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Keith Bacon - Looking for struts work - South-East UK.
phone UK 07960 011275

__________________________________________________
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
http://sports.yahoo.com

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