You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Danny Mui <da...@muibros.com> on 2002/10/24 04:39:26 UTC

Session Scope Newbie Question!

Hi All,

I typically use Request scope forms but alas, a session form fits the 
bill.  It's so much easier to assume the form instance will disappear 
but that is not the case with session scope form beans since I want to 
keep the values.

Everytime an action declares that it uses the form bean (a dynaform 
called countryForm) such as:

<action name="countryForm" scope="session" > ....

The full reset() and beanutil.populate() is called on it and all the 
values are replaced from the request and therefore overwriting 
everything!  I removed the "name" attribute from the actions that don't 
need to re-populate() and the jsp's using <bean:write name="countryForm" 
scope="session" /> works dandily.

My question is this, how do I use the form in actions without blowing 
away its values (from the request population) that "fits" into the 
Struts framework?  I've cheated in the past by pulling it out of the 
session explictly but that defeats the whole flexibility of a config file.

I look forward to hearing what I did/understood incorrectly.

Thanks.

danny


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>