This is expected behaviour, when you forward to your second Action Struts
will go through all its normal steps, finding/creating the ActionForm,
populating the form from the request, validating and then calling the
Action's execute method. So setting it to null isn't going to work, you need
to rethink how you design this.

Niall

----- Original Message ----- 
From: "pls" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, May 14, 2004 5:33 AM
Subject: How to set an ActionForm to null


> hi there,
>
> i am trying to set an actionform to null after inserting it's properties
> into a DB.
> then, control is forwarded to a different action and the info is read from
> the DB back into the actionform for display by a JSP.
>
> the only part that is giving me trouble is with explicitly setting my
> actionform "MBForm" to null.  After several form submissions and a DB
> update, the first Action attempts to clear the values in MBForm:
>
>       request.getSession().setAttribute("MBForm", null);
>
> after this, control is forwarded to the second Action which handles the
> display.  it checks to see if MBForm is null and, if it is, it fills
MBForm
> from a DB.   in between these two actions, the controller servlet is
> automatically refilling the MBForm with the values that I just nullified..
> the only bean property that stays empty is myHash which represents several
> groups of multiboxes.  i believe this is a result of the MBForm reset()
> method which contains the following:
>
>      myHash.put(multiBoxCategories, new Integer[0]);  //resets several
> groups of multiboxes
>
> setting other properties to null in the reset() method is not the solution
> as it wipes the value out after every (but somehow it doesn't do the same
> thing to the multiboxes?!?)
>
> let me know if this enough background for you to help me diagnose the
> problem..  any discussion of reset() or is welcome..  thanks
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to