You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by David Hoots <dl...@kietra.com> on 2002/02/28 23:34:32 UTC

Persisting values from a form

I have a form that is a set of criteria used for performing a search.  I don't need to persist the search criteria across Web sessions, but would like to persist them within a session.  Every time I go to the page that has the search criteria a new form instance gets created.  Could anybody tell me a way to get struts to reuse a form that was previously saved (in the session for example)?

Thanks in advance,
David

Re: Persisting values from a form

Posted by Bruce Geerdes <br...@sun.com>.
David Hoots wrote:

> I have a form that is a set of criteria used for performing a search.  I don't need to persist the search criteria across Web sessions, but would like to persist them within a session.  Every time I go to the page that has the search criteria a new form instance gets created.  Could anybody tell me a way to get struts to reuse a form that was previously saved (in the session for example)?

Have you tried setting the scope of the form to "session" in your struts-config?

    <action    path="/search"
               type="struts.SearchAction"
               name="searchForm"
               scope="session">
    </action>

Bruce


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