struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antony Stace <s45652...@yahoo.com>
Subject Re: Are Vectors in a FormAction set to null after a user has submitted a form?
Date Fri, 08 Feb 2002 02:01:40 GMT
Hi Rick

Thank you very much for the reply.

On Thu, 07 Feb 2002 13:17:45 -0700
Rick Holland <f17754c@cosd.fedex.com> wrote:

> Did you know that the ControllerServlet calls reset on a form before
> populating it
> from the request? If your form reset method clears the instvars it may
> be the problem.

If this is the case, does this mean that any form which is set to session scope in the struts-config.xml
file will have its reset() method called each time it is used by an action?Ie, If I have

   <action    path="/test1"
              type="TestAction" 
              scope="session"
              name="messageForm" 
              parameter="add"
   </action>
   <action    path="/test2"
              type="TestAction" 
              scope="session"
              name="messageForm" 
              parameter="del"
   </action>

And /test1 is called, the user enters data into the form and the data is saved in the messageForm
bean which is saved.  Later, the user
calls /test2, will the reset method in messageForm be called?


Cheers

Tony





> 
> Antony Stace wrote:
> 
> >Hi Chuck
> >
> >I just tried having the first actions scope set to scope="session" and the second
actions scope set to scope="session" 
> >and still the Vector data is still disapearing.  I actually, for a test, set another
field in ActionForm in the first action to a
> >test value, I didn't have this set on the form anywhere where the user could change
this value, then in the
> >second action I tried to access this data, but it was not there - it too was gone.
 Somehow a new form is being created
> >and the scope="session" is not happening.
> >Any ideas anyone?
> >
> >Cheers
> >
> >Tony
> >
> >
> >On Fri, 01 Feb 2002 07:51:12 -0500
> >Chuck Cavaness <struts-user@japache.org> wrote:
> >
> >>That's sort of what I was saying. In the second action, the one that is called
after the user sees the form data and makes some choices, does the scope equal to request
or session? If you have both of these actions defined as session scope, then I don't believe
a new ActionForm would be created during the second action. If the mapping is session, then
an ActionForm will be looked for in the session, which should have been put there on the previous
action (along with the Vector data in it still).
> >>
> >>However, if the second action is defined as request and the first one is session,
then yes the user entered data would make it to the new ActionForm and the Vector data would
be gone because one would be recycled.
> >>
> >>Obviously, this is all a guess. I hope it helps somehow.
> >>
> >>Chuck
> >>--
> >>Sent via jApache.org
> >>
> >>--
> >>To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
> >>For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>
> >>
> >
> >
> 
> -- 
> 
> ------------------------------------------------------------------
> - Rick Holland   OO/Distributed Systems Consultant
> - ObjectAge Inc.
> - rgholland1@fedex.com
>         "Logic is a wreath of pretty flowers, that smell bad"
> ------------------------------------------------------------------
> 
> 
> 


-- 


Cheers

Tony。
---------------------------------------------------------------------


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message