Hi there,

What I want to achieve:
I want to make a wizard which goes from one step to another and saves a 
complex object between all these requests. I thought about FlashScope 
but it does not work the way I want.

I have troubles when using the FlashScope - approach to store Objects 
between two requests. The problem is, that the ActionBean which I flash 
is not populated in the next request. Which means, regarding to the 
example at the end, when the method "step2" is called, the Set is null. 
But why?

Anyone an idea how to store and repopulate ActionBeans for using ONE and 
the SAME instance for the whole wizard?

Thanks in advance,
Regards,
Christoph

WizardTestActionBean.java
/*---------------------------------------------------------*/
public class WizardTestActionBean extends BasicActionBean {

   private Set<String> setToLife = null;

   @HandlesEvent("step1")
   public Resolution performStep1(){
     setToLive = new HashSet<String>();
     setToLive.add("Hello");
     setToLive.add("There");

     return new RedirectResolution("/wizard/step2.jsp").flash(this);
   }

   @HandlesEvent("step2")
   public Resolution performStep2(){
     if(setToLive == null || setToLive.size() != 2){
       System.err.println("setToLive not populated");
       return getContext().getSourcePageResolution();
     }
     return new RedirectResolution("/wizard/step3.jsp").flash(this);
   }
}
/*---------------------------------------------------------*/

wizard/step1.jsp

/*---------------------------------------------------------*/
<body>
   <stripes:form beanclass="itndb.stripes.WizardTestActionBean">
     <stripes:submit name="step1" value="next"></stripes:submit>
   </stripes:form>
</body>
/*---------------------------------------------------------*/

wizard/step2.jsp

/*---------------------------------------------------------*/
<body>
   <stripes:form beanclass="itndb.stripes.WizardTestActionBean">
     <stripes:submit name="step2" value="next"></stripes:submit>
   </stripes:form>
</body>


------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and 
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. 
Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to