struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ian Roughley <...@fdar.com>
Subject Re: Showing messages after a redirect
Date Tue, 01 Jul 2008 15:21:01 GMT
Have you looked at the message store interceptor?

/ian

Antonio Petrelli wrote:
> 2008/7/1 Dimitris Mouchritsas <dimitris.mouchritsas@eurodyn.com>:
>   
>> ActionMessages msg = new ActionMessages();
>> msg.add(Constants.MESSAGE_CONFIRM, new
>> ActionMessage("prompt.changes.saved"));
>> saveMessages(request, msg);
>>
>> But when I'm redirected back in the jsp there's no message showing (there's
>> a specific tile for
>> messages).
>>     
>
> Heh, that's a good one: I think it is not possible to use
> ActionMessages, since they remain active only in the current request.
> When you redirect you are in fact creating a new request, and the
> messages will disappear.
> Other frameworks, like Struts 2, have a "flash" scope, that is
> available just the time of one single redirect. It works by putting
> temporarily objects in session and then putting them back in request
> after the redirect.
> You could put these messages in session and use a filter (to .jsp
> files) to put them back to request.
> Or you can take a look at the "click" scope of Scopes:
> http://scopes.sourceforge.net/documentation/more-scopes/click-scope.html
>
> Antonio
>
> ---------------------------------------------------------------------
> 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


Mime
View raw message