You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Alireza Fattahi <Al...@pdpsoft.com> on 2002/11/19 08:57:20 UTC

Showing the success message

Hi,

There is a form which inserts to database. We want to show a success message
when this is done. The page redirects to itself after any validation error
or any success. 
Well, we use <html:error/> tag and this tag shows all the errors in request
scope.
How could we display the success messages for example "The user inserted to
database!"?
Is there any "special" mechanism in struts for this? Should we user
<html:error/> for this propose? Should we use ActionMessage?

Thanks,
Alireza.

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


RE: Showing the success message

Posted by Andrew Hill <an...@gridnode.com>.
I believe that ActionMessages were created for just this purpose.

-----Original Message-----
From: Míguel Ángel Mulero Martínez
[mailto:miguel-angel.mulero@mad.tecsidel.es]
Sent: Tuesday, November 19, 2002 16:07
To: Struts Users Mailing List
Subject: RE: Showing the success message


Put a message in the action (for example: request.setAttribute("message",
"Operation OK"))
And in the HTML page put: <bean:write name="message" ignore="true" />

The ignore="true" only prints the message if it exists.

Regards,
Miguel

> -----Mensaje original-----
> De: Alireza Fattahi [mailto:Alireza.Fattahi@pdpsoft.com]
> Enviado el: martes, 19 de noviembre de 2002 8:57
> Para: 'Struts Users Mailing List'
> Asunto: Showing the success message
>
>
> Hi,
>
> There is a form which inserts to database. We want to show a
> success message
> when this is done. The page redirects to itself after any validation error
> or any success.
> Well, we use <html:error/> tag and this tag shows all the errors
> in request
> scope.
> How could we display the success messages for example "The user
> inserted to
> database!"?
> Is there any "special" mechanism in struts for this? Should we user
> <html:error/> for this propose? Should we use ActionMessage?
>
> Thanks,
> Alireza.
>
> --
> 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>


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


RE: Showing the success message

Posted by Míguel Ángel Mulero Martínez <mi...@mad.tecsidel.es>.
Put a message in the action (for example: request.setAttribute("message",
"Operation OK"))
And in the HTML page put: <bean:write name="message" ignore="true" />

The ignore="true" only prints the message if it exists.

Regards,
Miguel

> -----Mensaje original-----
> De: Alireza Fattahi [mailto:Alireza.Fattahi@pdpsoft.com]
> Enviado el: martes, 19 de noviembre de 2002 8:57
> Para: 'Struts Users Mailing List'
> Asunto: Showing the success message
>
>
> Hi,
>
> There is a form which inserts to database. We want to show a
> success message
> when this is done. The page redirects to itself after any validation error
> or any success.
> Well, we use <html:error/> tag and this tag shows all the errors
> in request
> scope.
> How could we display the success messages for example "The user
> inserted to
> database!"?
> Is there any "special" mechanism in struts for this? Should we user
> <html:error/> for this propose? Should we use ActionMessage?
>
> Thanks,
> Alireza.
>
> --
> 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>