You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Rob Breeds <Ro...@uk.ibm.com> on 2001/11/14 17:03:01 UTC

request scope and forms

I'm getting stuck with request scope and ActionForm objects not sticking
around across requests.

If I have a jsp that has an input text field called name that populates a
corresponding field in an ActionForm called name, then that field gets
populated.

If the Action associated with this ActionForm then takes that name value
and adds it a different property in the ActionForm (say to a Vector) and
then forwards to the SAME input jsp again, why is it that a new ActionForm
object is instantiated every time (according to the log), such that
theActionForm never gets more than one String added to the Vector?

I was under the impression that if I forwarded, any ActionForm passed to
the Action would be persisted in the request.

Thanks

Rob Breeds



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


RE: request scope and forms

Posted by Robert Nocera <rn...@neosllc.com>.
If I understood your question correction, you probably want to use a
session scope bean.  In your case when the JSP is submitted each time a
new form bean is created because at that point it is a new request, not
a forward.

Robert Nocera
New England Open Solutions
www.neosllc.com
"You supply the vision, we'll do the rest."
 

-----Original Message-----
From: Rob Breeds [mailto:Rob_Breeds@uk.ibm.com] 
Sent: Wednesday, November 14, 2001 11:03 AM
To: Struts Users Mailing List
Subject: request scope and forms


I'm getting stuck with request scope and ActionForm objects not sticking
around across requests.

If I have a jsp that has an input text field called name that populates
a
corresponding field in an ActionForm called name, then that field gets
populated.

If the Action associated with this ActionForm then takes that name value
and adds it a different property in the ActionForm (say to a Vector) and
then forwards to the SAME input jsp again, why is it that a new
ActionForm
object is instantiated every time (according to the log), such that
theActionForm never gets more than one String added to the Vector?

I was under the impression that if I forwarded, any ActionForm passed to
the Action would be persisted in the request.

Thanks

Rob Breeds



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


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