struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gunnar Hillert <>
Subject [S2] ActionMessages and redirects
Date Mon, 04 Jun 2007 04:52:11 GMT


Still learning but I am really going to like Struts 2. An area where I find
it a bit lacking though (Compared to Struts 1) is the support for action
messages to survive redirects. 

I really like to follow the ‘Post/Redirect/Get pattern’ for most of my
(See also

Therefore in most of my actions I have the requirement that my success
messages survive the next redirect.

In Struts 1 I can do:

                       new ActionMessage("user.added"));
saveMessages(request.getSession(), messages);

But there is nothing like this in Struts 2.

I did not find too much information about this requirement in Struts 2. 
There are 2 open issues in Jira that touch the issue:

On of the issues mentions the MessageStore interceptor but that looks a bit
like overkill to me… (See also

Thus, for right now I am using Appfuse’s solution of using a custom filter. 

This works great but somehow feels like a ‘hack’ (Had to do the same for my
Spring MVC projects…)

* * *

In a perfect world I would like to see a feature similar to Ruby on Rails’
Flash which allows you to not only store messages but any object in a Flash,
and hence those objects survive the next redirect.

See also

But for the time being I would be already quite happy if there was a simple
and standardized way to have my actionMessages survive redirects.

What is the status on that? Is this something that will be added to one of
the next Struts 2 releases?

Thanks a lot! 


Gunnar Hillert 

View this message in context:
Sent from the Struts - User mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message