You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "pa.pinard@laposte.net" <pa...@laposte.net> on 2003/04/02 13:25:52 UTC

messages into struts 1.1

Hi everyone,

Is anybody knows how to use messages system of struts. I just 
want to print some information on the user screen, so I use an 
ActionMessages object, then i fill it with ActionMessage, I 
save it, and in my jsp, I use the tag <html:messages 
id="messages"> in which messages is the name of my svaed 
object, but nothing is printed out? So perhaps I do not use 
correctly this?

Cheers
Pierre

Accédez au courrier électronique de La Poste : www.laposte.net ; 
3615 LAPOSTENET (0,34€/mn) ; tél : 08 92 68 13 50 (0,34€/mn)"




---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: messages into struts 1.1

Posted by Gareth Andrew <ga...@ntlworld.com>.
I've just had a similar problem, recently. The docs seem to be a bit 
misleading (or perhaps the docs are right and theres a bug somewhere?).
<html:messages> doesn't seem to do any actual writing, its just a form 
of iterator that loops through the specified messages and puts them in a 
page-scope attribute. To actually display them you need to use <bean:write>
eg.
<html:messages id="message">
<bean:write name="message"/>
</html:messages>

Note you may also need to set the message paramater of the html:message 
tag to "true" if you have created your messages using the 
ActionMessages.GLOBAL_MESSAGE key as the tag (confusingly) defaults to 
using ActionErrors.GLOBAL_ERROR

Hope this helps,

Gareth

pa.pinard@laposte.net wrote:

>Hi everyone,
>
>Is anybody knows how to use messages system of struts. I just 
>want to print some information on the user screen, so I use an 
>ActionMessages object, then i fill it with ActionMessage, I 
>save it, and in my jsp, I use the tag <html:messages 
>id="messages"> in which messages is the name of my svaed 
>object, but nothing is printed out? So perhaps I do not use 
>correctly this?
>
>Cheers
>Pierre
>
>Accédez au courrier électronique de La Poste : www.laposte.net ; 
>3615 LAPOSTENET (0,34€/mn) ; tél : 08 92 68 13 50 (0,34€/mn)"
>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: messages into struts 1.1

Posted by Kirby Vandivort <kv...@ks.uiuc.edu>.
I was just running across this in something i was working on..

In the html tag, try

<html:messages id="messages" message="true">

and see if that helps.

On Wed, Apr 02, 2003 at 12:25:52PM +0100, pa.pinard@laposte.net wrote:
> Hi everyone,
> 
> Is anybody knows how to use messages system of struts. I just 
> want to print some information on the user screen, so I use an 
> ActionMessages object, then i fill it with ActionMessage, I 
> save it, and in my jsp, I use the tag <html:messages 
> id="messages"> in which messages is the name of my svaed 
> object, but nothing is printed out? So perhaps I do not use 
> correctly this?
> 
> Cheers
> Pierre
> 
> Accédez au courrier électronique de La Poste : www.laposte.net ; 
> 3615 LAPOSTENET (0,34€/mn) ; tél : 08 92 68 13 50 (0,34€/mn)"
> 
> 
> 

-- 

Kirby Vandivort                      Theoretical and Computational Biophysics 
Email: kvandivo@ks.uiuc.edu          3051 Beckman Institute
http://www.ks.uiuc.edu/~kvandivo/    University of Illinois
Phone: (217) 244-5711                405 N. Mathews Ave
Fax  : (217) 244-6078                Urbana, IL  61801, USA

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org