If you're manually calling your formbean's "setter" methods then you'll need
to then re-add the formbean to the session (or request or whatever scope you
are using).  I don't know what you're trying to do, but I've never manually
called any such setter methods.  They're usually called automatically when
you submit a form to an Action class (i.e. the action-mapping element of
struts-config tells Struts which formbean to populate for the specified
action and what scope to give it).  

I'd stick with request scope for formbeans, but it does not sound like you
are using them in the conventional way - so maybe some more detail on what
you're trying to do would help. 

Lindsay

 -----Original Message-----
From:   Kevin J. Turner [mailto:[EMAIL PROTECTED]] 
Sent:   19 March 2002 15:26
To:     Struts Users Mailing List
Subject:        Form beans in session scope

I have configured my struts-config file to keep my form bean in
session scope. I don't know if this is good practice, but I wasn't
having much luck with the request scope.

In many of my action classes, if have to get a reference to my form 
bean to do some business logic processing. I do so by doing the
following:

   MyFormBean mfb =3D (MyFormBean) form

Then I call some methods....

   mfb.setAlpha("beta");
   mfb.setGamma("delta");
   etc..

At this point do I need to explicitly re-add/reset the form bean by 
doing something like this:

   session.setAttribute(mapping.getAttribute(), mfb);

Or does calling the methods automatically update the form bean thats 
in the session?

<k>


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