Multi-page form bean persistence

2001-08-14 Thread Richard William Lake

I have a multi-page form to manipulate a 2-level tree structure, so one of the 
variables of my ActionForm specifies which branch of the tree is shown, and I have no 
problem switching between branches to view the data. I'm using another variable to 
define a cancel/commit status of the form, which defines when the user has chosen to 
finish editing. If this status is not set then the Action forwards to the Input form.

The form transfers properties between pages by using  tags. The problem 
is that the data structure does not persist (it is a member variable of the form 
class) between requests, even though it is only created if the variable is null and it 
is not set in the reset method. I have also tried using "session" scope for the form, 
with no noticeable difference.

Perhaps there is somebody who can explain how to achieve form persistance across pages 
(the view is the same for all "pages" in my case) or is this a "grey-area" at the 
moment in this excellent framework?

I would also like to use multiple data sources for the benefits of connection pooling. 
I couldn't find any mention of documentation describing how to define this. Is there a 
property of the XML tag to give a database a named reference?
* Actually, I couldn't find any documentation detailing the precise structure and 
layout of the "struts-config.xml" file.

As a final point, it would be nice to see a "how-to" article section on the Struts 
website with minimal examples of such scenarios or building blocks if you like. I 
wonder if this has been discussed before?

Regards,
Richard



Re: Multi-page form bean persistence

2001-08-14 Thread Brian . Duchouquette


Richard,

I can think of 2 things that may cause the data structure to not persist.
1.  The framework might be calling an implemented reset() method on your
formbean.  To get multi-page formbeans to work, I had to avoid
implementation of this method (since it is called between requests).  2.
You may have code in your action class that is disposing of your formbean.

Brian




   

Richard

William Lake To: [EMAIL PROTECTED]

<[EMAIL PROTECTED]cc:   

n.ac.uk> Subject: Multi-page form bean persistence 

   

08/14/2001 

09:16 AM   

Please 

respond to 

struts-user

   

   





I have a multi-page form to manipulate a 2-level tree structure, so one of
the variables of my ActionForm specifies which branch of the tree is shown,
and I have no problem switching between branches to view the data. I'm
using another variable to define a cancel/commit status of the form, which
defines when the user has chosen to finish editing. If this status is not
set then the Action forwards to the Input form.

The form transfers properties between pages by using  tags.
The problem is that the data structure does not persist (it is a member
variable of the form class) between requests, even though it is only
created if the variable is null and it is not set in the reset method. I
have also tried using "session" scope for the form, with no noticeable
difference.

Perhaps there is somebody who can explain how to achieve form persistance
across pages (the view is the same for all "pages" in my case) or is this a
"grey-area" at the moment in this excellent framework?

I would also like to use multiple data sources for the benefits of
connection pooling. I couldn't find any mention of documentation describing
how to define this. Is there a property of the XML tag to give a database a
named reference?
* Actually, I couldn't find any documentation detailing the precise
structure and layout of the "struts-config.xml" file.

As a final point, it would be nice to see a "how-to" article section on the
Struts website with minimal examples of such scenarios or building blocks
if you like. I wonder if this has been discussed before?

Regards,
Richard