Do you need to store more than one instance of your "db-row" bean per
session?  If not, then I would just store the bean in the session like so:

request.getSession().setAttribute("MyActionClass.dbRowBeanClassName",
dbRowBeanInstance)

Of course, you're free to use whatever identifier you like, but I use the
Action Class name followed by a '.' and then the class name of the bean I'm
storing.  The other option, if the form bean has session scope, is to create
a field in your form bean for the dbRowBean and store it there instead.

If you need to store more than one dbRowBean object per session, you'll have
to come up with a naming scheme of some sort. :)

cheers,
Joe

-----Original Message-----
From: Bhaskar Gopalan [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 15, 2002 11:37 AM
To: Struts Group (E-mail)
Subject: Managing bean


Hi,
I'm new to struts and have this question:

I have a jsp that talks to a form bean. After successful validation, this
formbean is
passed to action.perform(). Now I am creating a bean (corresponding to a db
row) in
the action class using the data from the formbean. Now, where do I store
this bean
and how do I access it from the action class later? I guess only one
instance of
the action is created for all the sessions. So, I cannot store the bean as
an
instance variable of the action class.

Thnx,
GB

--
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