It seems as though the majority of times your ActionForms should use
request scope, but what about situations where you might grab data
from one jsp form and then need to use the information you got from
that page during other parts of your application. Here's the actual
situation...

1) user has to select a "userType" from some select options.
2) once this "userType" is selected I need to use this property in
some DispatchAction methods and as a display on some other pages as
the user traverses the application. (the "userType" can change if he/she
goes back to the original form and selects a new one).

Now the question is where should the "userType" field be stored so I
have access to it in other parts of the user's session? I first
thought it would be best stored as a field in my ActionForm with
session scope so that other pages and Actions could have access to it,
but if reset() is always called regardless of the scope it seems to
imply that the ActionForms shouldn't really be used in Sesion scope?
(Even though the default reset behavior wouldn't reset my field upon
each request unless I provide implementation, it seems to imply that I
should provide the implementation, and definitely as Chuck pointed out
to me, in the case of DynaActionForms, the reset will truly reset the
fields to default values, which means if I use a DynaActionForm and
want it in Session scope I have to override the reset() method and
make sure it doesn't touch the fields I want to keep in the session.
That sort of seems ugly to me.)

Am I better off just sticking the "userType" variable itself into the
session after I get it from the Form? Or maybe just put it into
the DTO (that I eventually convert the ActionForm into anyway) and
then stick that DTO in the session?

Thanks for any comments.

-- 

Rick
mailto:[EMAIL PROTECTED]

"Any man, in the right situation, is capable of murder. But not any
man is capable of being a good camper. So, murder and camping are not
as similar as you might think." 
  -Jack Handey


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

Reply via email to