Why don't you store the temporary object in the session object and check to
see if the object exists when rendering the form?

-----Original Message-----
From: Struts Newsgroup [mailto:@[EMAIL PROTECTED]]
Sent: Wednesday, April 03, 2002 9:55 AM
To: [EMAIL PROTECTED]
Subject: storing data beyond single page scope without commiting to
database


Subject: storing data beyond single page scope without commiting to database
From: Simon Kirk <[EMAIL PROTECTED]>
 ===
Hello all,
I have a system where I am creating an object with a certain amount of
data, let's call it object A. It references to one or more object Bs that
can be said to 'belong' to it. Let's say that there are not any object Bs
that fit the criteria of what I want, so in my form to input an object A, I
have a button to add an object B to go with it.

What I could do is when I click the button to create a new
object B, I submit the data so far entered for object A and store the data
in a database. I then enter my data for object B, submit, and get taken
back to object A where my form entries are restored, together with the new
object B in, say, a drop down list. However this raises the problem that
the data for the incomplete object A could become available to other users
unless I put in an 'active' flag or something like it so that until I
finally submit the data for object A other users can't see it.

What I would *like* to do is store the data for object A in the form bean
for it and retrieve it later on after creating object B. This seems to be
an issue of scope. I feel this is probably something people have done a lot
before, but I can't find anything that concisely and clearly explains it on
the struts website. Can anybody suggest something, or point me in the
direction of things to read?

Incidentally, I suppose one way around it would be to maintain a database
connection and only commit my changes for the object A on completion of
submission for both A and B, but I'm using a database connection pool
anyway which would negate this, no?

Many thanks for any help.
Simon

--
Simon Kirk
perception|be.developer(java)
t. +44 (0) 20 7689 1200

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


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

Reply via email to