struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Laurie Harper <lau...@holoweb.net>
Subject Re: Session scope ActionMessages
Date Fri, 08 Sep 2006 18:52:11 GMT
Kevin Maeer wrote:
> Hi,
> 
> I'm using ActionMessages stored in the session to display messages on a page and
> everything works splendidly except that the messages never get removed from the
> session so every time the user re-enters the page old messages get redisplayed.
> After a bit of digging around, this appears to be because I am using my own keys
> (instead of Globals.MESSAGE_KEY and Globals.ERROR_KEY) so the RequestProcessor's
> processCachedMessages method doesn't clear out the messages.
> 
> How have other people got around this? Is the simplest/cleanest option to
> subclass RequestProcessor and override the processCachedMessages method to
> remove any attribute that is an instance of ActionMessages and that has
> isAccessed() = true?
> 
> We're using Struts 1.2.7.

The simplest options would seem to be not to store messages in a 
non-standard place, so the standard clean-up will work... If you can 
explain why you're doing that, maybe we can suggest an alternative approach.

Failing that, your solution sounds like it should be workable -- 
provided you have a fixed / constrained set of session scope keys to 
clean up.

L.


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


Mime
View raw message