Hai wrote:
> I often stored my form beans in a session scope.  I've a routine that
> looping through the session and destroy the unused forms.  The tricky part
> is how to determine with forms are no longer in used.
> Anyone out there using this technique?

I'm storing ActionForm instances in session scope because I do some bouncing
around between resolution screens (user types a name, gets a list of
matches, picks one, goes back to main form) and I don't want to put all that
junk in hidden fields on the resolution screen so that it will be in the
Request when I come back to the main form.

This means that I'm not using the reset method-- the form gets initialized
with what's read from the database, and then it sits in session scope
getting manipulated by EditContactAction and ProcessContactAction until the
user is happy.  (No checkboxes, so there's nothing to "reset".)

I'm not quite there yet, but once I write the record to the DB, I will
manually remove the form from the session.

Then atta asked:
> Now is there a way to store collections in the request
> scope instead of session scope? by collections I mean, collections used to
> populate <html:select> controls?

You can set request attributes:

public void setAttribute(java.lang.String name, java.lang.Object o)
Stores an attribute in this request. Attributes are reset between requests. 

-- 
Wendy Smoak
Applications Systems Analyst, Sr.
Arizona State University PA Information Resources Management

Reply via email to