You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Karen <ke...@bigpond.com> on 2001/06/14 13:48:44 UTC

Problems with session scope forms disappearing

Hi Everyone,

I've been using Struts for a while now, and have come across a problem whereby trying to pass a form (with all struts-config entries being scope="session") between multiple different actions (same form) will lose all previously entered data - I'm trying to map each page in a process to an action class, however I'm not writing the data to the database until the last page has been submitted as the user may want to go back and foward several times.

Should it be possible to do this ?

I've got a number of actions working with different action entries (ie. paths), however pointing to the same type (ie. java action class)and form to allow different pages to have different 'success' and 'failure' mappings, however I've found that a few of these classes are becoming quite large and unmanageable, and I would like to clean this up by having a different action per web page, but only 1 form for all data.

Any help would be gratefully received..

Regards,
Don Elliott

Re: Problems with session scope forms disappearing

Posted by Jean-Noel Ribette <je...@improve.fr>.
I think you got this behaviour because Struts is calling the reset() method before of the form populating it, so the
form is reinitialize betwen each actions.

You can solve this problem by having a blank reset() method and a realReset() method that you can from your action class
when needed.

Jean-Noel

----- Original Message -----
From: Karen <ke...@bigpond.com>
To: <st...@jakarta.apache.org>
Sent: Thursday, June 14, 2001 1:48 PM
Subject: Problems with session scope forms disappearing


Hi Everyone,

I've been using Struts for a while now, and have come across a problem whereby trying to pass a form (with all
struts-config entries being scope="session") between multiple different actions (same form) will lose all previously
entered data - I'm trying to map each page in a process to an action class, however I'm not writing the data to the
database until the last page has been submitted as the user may want to go back and foward several times.

Should it be possible to do this ?

I've got a number of actions working with different action entries (ie. paths), however pointing to the same type (ie.
java action class)and form to allow different pages to have different 'success' and 'failure' mappings, however I've
found that a few of these classes are becoming quite large and unmanageable, and I would like to clean this up by having
a different action per web page, but only 1 form for all data.

Any help would be gratefully received..

Regards,
Don Elliott