2012/10/16 Chris Cheshire <cheshira...@gmail.com>:
> I have all my JSPs fronted by action beans with a view() resolution.
> Generally if errors happen in processing (other than field
> validation), I use LocalizableMessages and store them in the messages
> collection in the stripes context. If the action forwards to its own
> JSP, the messages tag renders them properly.
>
> If the action redirects to another action, the messages never display.
> The URL comes back with the flash scope id (__fsk=...) but the
> messages from the previous action aren't there.
>
>
> This works - the message(s) render on JSP2
>
> Class 1 :
>
> public Resolution view() {
>     /** some processing **/
>    getContext().getMessages().add(new
> LocalizableMessage("key.in.StripesResources.properties"));
>    return new ForwardResolution(Class2);
> }
>
> Class 2 :
>
> public Resolution view() {
>     /** some other processing that does not touch the context messages **/
>    return new ForwardResolution("/path/to/JSP2");
> }
>
>
> If I change the ForwardResolution in Class1 to a RedirectResolution,
> the messages do not render on JSP2. Am I misunderstanding how the
> flash scope works, or is something broken/misconfigured somewhere?

That's not how the flash scope is used, cf.
http://stripesframework.org/display/stripes/State+Management#StateManagement-RedirectafterPost
for an example. You're currently adding messages to the request scope,
not the flash scope, which explains why they're lost after a redirect.

Frank

------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to