Gday,....

I have a method in an action bean that save message into the context, then
does a redirect to the same action bean.... and in the event handler
that handles the redirection, it adds further message. Somehow... the
message that was added in the first place was lost.

The code (pseudo) looks like below:

public class SomeActionBean implements ActionBean{

       @HandlesEvent("save")
       public Resolution save(){
              // save to database
             context.getMessages().add(....);
              return new RedirectResolution(this.getClass(),
"load");
       }

       @HandlesEvent("load")
       public Resolution load(){
                  // load from database
                  context.getMessages().add(....);
                  return new ForwardResolution("/WEB-INF/jsp/....");
        }
}

As explained before... the messages I added in the save() method was lost.
In fact.... I have a simple test case as follow:

public class SomeActionBean implements ActionBean{

       @HandlesEvent("save")
       public Resolution save(){
              // save to database
             context.getMessages().add(....);
              return new RedirectResolution(this.getClass(),
"load");
       }

       @HandlesEvent("load")
       public Resolution load(){
                  // load from database
                  context.getMessages();
                  return new ForwardResolution("/WEB-INF/jsp/....");
        }
}


i.e..  the load() method does nothing to the messages.... it just try to get
the list of messages from the context.
In the code above, the method context.getMessages() will blow away all the
messages in the FlashScope.
If I dont have the context.getMessages() in the load() method, the message
will be displayed in the JSP.
Has anyone seen this before? Am I doing some silly mistake?
Not sure if this makes any difference.. but I'm running Tomcat 6.

Thanks in advance....



-- 
Best regards,


WiB
------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have 
the opportunity to enter the BlackBerry Developer Challenge. See full prize 
details at: http://p.sf.net/sfu/blackberry
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to