[ http://mc4j.org/jira/browse/STS-325?page=comments#action_10562 ] Tim Fennell commented on STS-325: ---------------------------------
The messages *are* there, you're just looking in the wrong place. I'm not suggesting that this isn't a bug - but rather that the bug is that the flash scope can be a bit confusing at times :) In general the way the flash scope works is that you put stuff in and Stripes puts the object into Request and into a Map that will be used on the subsequent request. On the subsequent request Stripes takes the contents of the Map and drops it into request attributes for the current request. Now, when you call getMessages() in the 2nd bean it's looking in the /current/ flash scope - the one that will be used to populate things into the next request, instead of the /previous/ flash scope that was used to populate items into this request. I'm not sure yet what the right solution is, but clearly this is confusing (it's caught other people out too). We need to find a solution that exposes things to the EL/page appropriately, but is less confusing when in ActionBeans. > Messages disappear under certain circumstances when performing a redirect > ------------------------------------------------------------------------- > > Key: STS-325 > URL: http://mc4j.org/jira/browse/STS-325 > Project: Stripes > Issue Type: Bug > Components: Context Management > Affects Versions: Release 1.4.2 > Environment: Win XP SP2, JBoss 4.0.5, Eclipse 3.2.1, Java 1.5.0_09, > Stripes 1.4.2 > Reporter: Ed Smith > Assigned To: Tim Fennell > Priority: Minor > > The scenario involves performing a database update during an action from Page > A then redirecting to Page B and displaying a status message. The message is > populated during the Page A action using getContext().getMessages().add() and > survives under normal circumstances in FlashScope to be displayed by Page B. > However, in this case Page B contains a <stripes:useActionBean/> tag and in > the called event I am attempting to determine whether or not there exist any > messages in the context: > if (getContext().getMessages().size() > 0) > log.info("There are messages in the context"); > When this code snippet executes during the useActionBean event for Page B, > the context does not see the messages already in FlashScope and consequently > returns a new List<Message> with size == zero and the log statement never > executes. Also, no messages are displayed by <stripes:messages/> in Page B. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://mc4j.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Stripes-development mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/stripes-development
