You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Chris Pat <cp...@yahoo.com> on 2005/11/10 05:03:53 UTC

cant reset form

Hello
I have an app with three fields on the form.  It all
works fine and I even have the Reset method assigning
blank strings.  The problem, Reset never works.  I
submit the form and the form values  do not clear. 
This is even more unbelievable, I down TC, recompile
the war, place it in webapps, start TC, and STILL the
same values.  How can this happern, what am I clearly
not doing?  

Also, If I wanted the form to keep a dynamic list per
field of the values entered per session per form with
the browser, is there an easy way to do that?  Thank you.


	
		
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

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


Re: cant reset form

Posted by ra...@tcs.com.
Hi Chris,
        Why don't you try making the scope of the form as "request" ?





Chris Pat <cp...@yahoo.com> 
11/10/2005 09:33 AM
Please respond to
"Struts Users Mailing List" <us...@struts.apache.org>


To
Struts Users Mailing List <us...@struts.apache.org>
cc

Subject
cant reset form






Hello
I have an app with three fields on the form.  It all
works fine and I even have the Reset method assigning
blank strings.  The problem, Reset never works.  I
submit the form and the form values  do not clear. 
This is even more unbelievable, I down TC, recompile
the war, place it in webapps, start TC, and STILL the
same values.  How can this happern, what am I clearly
not doing? 

Also, If I wanted the form to keep a dynamic list per
field of the values entered per session per form with
the browser, is there an easy way to do that?  Thank you.


 
 
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

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


ForwardSourceID:NT0000801E 


Notice: The information contained in this e-mail message and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments. Thank you


Re: cant reset form

Posted by Chris Pat <cp...@yahoo.com>.
Hi Paul
Sorry.  The more I think about there are probably
better and more secure ways to do and not to do it.  I
was thinking of form with fields that "remembered" the
last n number of entries and made then available on a
combo box in the field for repeated entry.  It
definitely would not be good for a banking but there
likely some legitimate or enduser convenience uses. 
It really explores what can be done with an
ActionForm.  I know the answer is probably, "anything
you want, it is a bean".  Sorry if I just wasted you
and others time.  

--- Paul Benedict <pa...@yahoo.com> wrote:

> >>Not to be greedy, however is it possible to have a
> >>form dynamically save and make selectable the
> previous
> >>field entries?
> 
> You need to be more clear. I don't understand this.
> 
> 
> 
> 
> 		
> __________________________________ 
> Yahoo! FareChase: Search multiple travel sites in
> one click.
> http://farechase.yahoo.com
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> For additional commands, e-mail:
> user-help@struts.apache.org
> 
> 



	
		
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

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


Re: cant reset form

Posted by Paul Benedict <pa...@yahoo.com>.
>>Not to be greedy, however is it possible to have a
>>form dynamically save and make selectable the previous
>>field entries?

You need to be more clear. I don't understand this.




		
__________________________________ 
Yahoo! FareChase: Search multiple travel sites in one click.
http://farechase.yahoo.com

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


RE: cant reset form

Posted by "David G. Friedman" <hu...@ix.netcom.com>.
Chris,

What do you want to do, push the results onto
a stack/list to pop them back out if you need
to change something, or would an HTML form's
reset button work for you (as a client-side
solution).

Regards,
David

-----Original Message-----
From: Chris Pat [mailto:cpanon@yahoo.com]
Sent: Thursday, November 10, 2005 12:10 AM
To: Struts Users Mailing List
Subject: Re: cant reset form


Hi Paul
A very complete and informative answer.  I learned. 
Thanks.

Not to be greedy, however is it possible to have a
form dynamically save and make selectable the previous
field entries?  From this discussion it seems like no.
 Is that something you would do in the ActionForm? 
Broadly speaking, how much processing can I do in an
ActionForm?  Right now I just see it as a passive
conduit into the Action, maybee with validation.  Are
they useful beyond that?

--- Paul Benedict <pa...@yahoo.com> wrote:

> Pat, forms are stored in the sesion. If you want to
> reset it, simply remove it from the session
> like the following:
>
request.getSession(false).removeAttribute("yourFormName");
> 
> The next time Struts invokes the action, it will
> re-create it if it is missing. So you're learning
> the downside of using session forms, which is that
> you have to clear it out of memory when you're
> finished.
> 
> -- Paul
> 
> --- Chris Pat <cp...@yahoo.com> wrote:
> 
> > Thanks Pat & rajasekhar
> > I will do that.  
> > However is there a way to stop the serialization
> or
> > force the clearing of the form fields and keep the
> > session otherwise instantiated?  I can see the
> need
> > store/create objects in the session, possibly with
> a
> > form bean, but want my fields clear.  Just a
> newbie. 
> > Thanks.
> > 
> > --- Paul Benedict <pa...@yahoo.com> wrote:
> > 
> > > Pat,
> > > 
> > > It's possible by restarting the tomcat server,
> > > you're serializing the session -- it's called a
> > > "sticky session" -- which sticks around between
> > > restarts. 
> > > 
> > > I am not aware of anyone using reset(). If you
> also
> > > need to clear the form fields, why not use a
> > > request scope form? It sounds like you have your
> > > form in session scope so the last submit is
> > > always in memory; set scope="request" on the
> > > <action> definition and this will solve it. 
> > > 
> > > --- Chris Pat <cp...@yahoo.com> wrote:
> > > 
> > > > Hello
> > > > I have an app with three fields on the form. 
> It
> > > all
> > > > works fine and I even have the Reset method
> > > assigning
> > > > blank strings.  The problem, Reset never
> works.  I
> > > > submit the form and the form values  do not
> clear.
> > > 
> > > > This is even more unbelievable, I down TC,
> > > recompile
> > > > the war, place it in webapps, start TC, and
> STILL
> > > the
> > > > same values.  How can this happern, what am I
> > > clearly
> > > > not doing?  
> > > > 
> > > > Also, If I wanted the form to keep a dynamic
> list
> > > per
> > > > field of the values entered per session per
> form
> > > with
> > > > the browser, is there an easy way to do that? 
> > > Thank you.
> > > > 
> > > > 
> > > > 	
> > > > 		
> > > > __________________________________ 
> > > > Yahoo! Mail - PC Magazine Editors' Choice 2005
> 
> > > > http://mail.yahoo.com
> > > > 
> > > >
> > >
> >
>
---------------------------------------------------------------------
> > > > To unsubscribe, e-mail:
> > > user-unsubscribe@struts.apache.org
> > > > For additional commands, e-mail:
> > > user-help@struts.apache.org
> > > > 
> > > > 
> > > 
> > > 
> > > 
> > > 	
> > > 		
> > > __________________________________ 
> > > Yahoo! Mail - PC Magazine Editors' Choice 2005 
> > > http://mail.yahoo.com
> > > 
> > >
> >
>
---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > > user-unsubscribe@struts.apache.org
> > > For additional commands, e-mail:
> > > user-help@struts.apache.org
> > > 
> > > 
> > 
> > 
> > 
> > 	
> > 		
> > __________________________________ 
> > Yahoo! Mail - PC Magazine Editors' Choice 2005 
> > http://mail.yahoo.com
> > 
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> > For additional commands, e-mail:
> user-help@struts.apache.org
> > 
> > 
> 
> 
> 
> 	
> 		
> __________________________________ 
> Yahoo! Mail - PC Magazine Editors' Choice 2005 
> http://mail.yahoo.com
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> For additional commands, e-mail:
> user-help@struts.apache.org
> 
> 



		
__________________________________ 
Yahoo! FareChase: Search multiple travel sites in one click.
http://farechase.yahoo.com

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


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


Re: cant reset form

Posted by Chris Pat <cp...@yahoo.com>.
Hi Paul
A very complete and informative answer.  I learned. 
Thanks.

Not to be greedy, however is it possible to have a
form dynamically save and make selectable the previous
field entries?  From this discussion it seems like no.
 Is that something you would do in the ActionForm? 
Broadly speaking, how much processing can I do in an
ActionForm?  Right now I just see it as a passive
conduit into the Action, maybee with validation.  Are
they useful beyond that?

--- Paul Benedict <pa...@yahoo.com> wrote:

> Pat, forms are stored in the sesion. If you want to
> reset it, simply remove it from the session
> like the following:
>
request.getSession(false).removeAttribute("yourFormName");
> 
> The next time Struts invokes the action, it will
> re-create it if it is missing. So you're learning
> the downside of using session forms, which is that
> you have to clear it out of memory when you're
> finished.
> 
> -- Paul
> 
> --- Chris Pat <cp...@yahoo.com> wrote:
> 
> > Thanks Pat & rajasekhar
> > I will do that.  
> > However is there a way to stop the serialization
> or
> > force the clearing of the form fields and keep the
> > session otherwise instantiated?  I can see the
> need
> > store/create objects in the session, possibly with
> a
> > form bean, but want my fields clear.  Just a
> newbie. 
> > Thanks.
> > 
> > --- Paul Benedict <pa...@yahoo.com> wrote:
> > 
> > > Pat,
> > > 
> > > It's possible by restarting the tomcat server,
> > > you're serializing the session -- it's called a
> > > "sticky session" -- which sticks around between
> > > restarts. 
> > > 
> > > I am not aware of anyone using reset(). If you
> also
> > > need to clear the form fields, why not use a
> > > request scope form? It sounds like you have your
> > > form in session scope so the last submit is
> > > always in memory; set scope="request" on the
> > > <action> definition and this will solve it. 
> > > 
> > > --- Chris Pat <cp...@yahoo.com> wrote:
> > > 
> > > > Hello
> > > > I have an app with three fields on the form. 
> It
> > > all
> > > > works fine and I even have the Reset method
> > > assigning
> > > > blank strings.  The problem, Reset never
> works.  I
> > > > submit the form and the form values  do not
> clear.
> > > 
> > > > This is even more unbelievable, I down TC,
> > > recompile
> > > > the war, place it in webapps, start TC, and
> STILL
> > > the
> > > > same values.  How can this happern, what am I
> > > clearly
> > > > not doing?  
> > > > 
> > > > Also, If I wanted the form to keep a dynamic
> list
> > > per
> > > > field of the values entered per session per
> form
> > > with
> > > > the browser, is there an easy way to do that? 
> > > Thank you.
> > > > 
> > > > 
> > > > 	
> > > > 		
> > > > __________________________________ 
> > > > Yahoo! Mail - PC Magazine Editors' Choice 2005
> 
> > > > http://mail.yahoo.com
> > > > 
> > > >
> > >
> >
>
---------------------------------------------------------------------
> > > > To unsubscribe, e-mail:
> > > user-unsubscribe@struts.apache.org
> > > > For additional commands, e-mail:
> > > user-help@struts.apache.org
> > > > 
> > > > 
> > > 
> > > 
> > > 
> > > 	
> > > 		
> > > __________________________________ 
> > > Yahoo! Mail - PC Magazine Editors' Choice 2005 
> > > http://mail.yahoo.com
> > > 
> > >
> >
>
---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > > user-unsubscribe@struts.apache.org
> > > For additional commands, e-mail:
> > > user-help@struts.apache.org
> > > 
> > > 
> > 
> > 
> > 
> > 	
> > 		
> > __________________________________ 
> > Yahoo! Mail - PC Magazine Editors' Choice 2005 
> > http://mail.yahoo.com
> > 
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> > For additional commands, e-mail:
> user-help@struts.apache.org
> > 
> > 
> 
> 
> 
> 	
> 		
> __________________________________ 
> Yahoo! Mail - PC Magazine Editors' Choice 2005 
> http://mail.yahoo.com
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> For additional commands, e-mail:
> user-help@struts.apache.org
> 
> 



		
__________________________________ 
Yahoo! FareChase: Search multiple travel sites in one click.
http://farechase.yahoo.com

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


Re: cant reset form

Posted by Paul Benedict <pa...@yahoo.com>.
Pat, forms are stored in the sesion. If you want to reset it, simply remove it from the session
like the following: request.getSession(false).removeAttribute("yourFormName");

The next time Struts invokes the action, it will re-create it if it is missing. So you're learning
the downside of using session forms, which is that you have to clear it out of memory when you're
finished.

-- Paul

--- Chris Pat <cp...@yahoo.com> wrote:

> Thanks Pat & rajasekhar
> I will do that.  
> However is there a way to stop the serialization or
> force the clearing of the form fields and keep the
> session otherwise instantiated?  I can see the need
> store/create objects in the session, possibly with a
> form bean, but want my fields clear.  Just a newbie. 
> Thanks.
> 
> --- Paul Benedict <pa...@yahoo.com> wrote:
> 
> > Pat,
> > 
> > It's possible by restarting the tomcat server,
> > you're serializing the session -- it's called a
> > "sticky session" -- which sticks around between
> > restarts. 
> > 
> > I am not aware of anyone using reset(). If you also
> > need to clear the form fields, why not use a
> > request scope form? It sounds like you have your
> > form in session scope so the last submit is
> > always in memory; set scope="request" on the
> > <action> definition and this will solve it. 
> > 
> > --- Chris Pat <cp...@yahoo.com> wrote:
> > 
> > > Hello
> > > I have an app with three fields on the form.  It
> > all
> > > works fine and I even have the Reset method
> > assigning
> > > blank strings.  The problem, Reset never works.  I
> > > submit the form and the form values  do not clear.
> > 
> > > This is even more unbelievable, I down TC,
> > recompile
> > > the war, place it in webapps, start TC, and STILL
> > the
> > > same values.  How can this happern, what am I
> > clearly
> > > not doing?  
> > > 
> > > Also, If I wanted the form to keep a dynamic list
> > per
> > > field of the values entered per session per form
> > with
> > > the browser, is there an easy way to do that? 
> > Thank you.
> > > 
> > > 
> > > 	
> > > 		
> > > __________________________________ 
> > > Yahoo! Mail - PC Magazine Editors' Choice 2005 
> > > http://mail.yahoo.com
> > > 
> > >
> >
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > user-unsubscribe@struts.apache.org
> > > For additional commands, e-mail:
> > user-help@struts.apache.org
> > > 
> > > 
> > 
> > 
> > 
> > 	
> > 		
> > __________________________________ 
> > Yahoo! Mail - PC Magazine Editors' Choice 2005 
> > http://mail.yahoo.com
> > 
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > user-unsubscribe@struts.apache.org
> > For additional commands, e-mail:
> > user-help@struts.apache.org
> > 
> > 
> 
> 
> 
> 	
> 		
> __________________________________ 
> Yahoo! Mail - PC Magazine Editors' Choice 2005 
> http://mail.yahoo.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 



	
		
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

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


Re: cant reset form

Posted by Chris Pat <cp...@yahoo.com>.
Thanks Pat & rajasekhar
I will do that.  
However is there a way to stop the serialization or
force the clearing of the form fields and keep the
session otherwise instantiated?  I can see the need
store/create objects in the session, possibly with a
form bean, but want my fields clear.  Just a newbie. 
Thanks.

--- Paul Benedict <pa...@yahoo.com> wrote:

> Pat,
> 
> It's possible by restarting the tomcat server,
> you're serializing the session -- it's called a
> "sticky session" -- which sticks around between
> restarts. 
> 
> I am not aware of anyone using reset(). If you also
> need to clear the form fields, why not use a
> request scope form? It sounds like you have your
> form in session scope so the last submit is
> always in memory; set scope="request" on the
> <action> definition and this will solve it. 
> 
> --- Chris Pat <cp...@yahoo.com> wrote:
> 
> > Hello
> > I have an app with three fields on the form.  It
> all
> > works fine and I even have the Reset method
> assigning
> > blank strings.  The problem, Reset never works.  I
> > submit the form and the form values  do not clear.
> 
> > This is even more unbelievable, I down TC,
> recompile
> > the war, place it in webapps, start TC, and STILL
> the
> > same values.  How can this happern, what am I
> clearly
> > not doing?  
> > 
> > Also, If I wanted the form to keep a dynamic list
> per
> > field of the values entered per session per form
> with
> > the browser, is there an easy way to do that? 
> Thank you.
> > 
> > 
> > 	
> > 		
> > __________________________________ 
> > Yahoo! Mail - PC Magazine Editors' Choice 2005 
> > http://mail.yahoo.com
> > 
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> > For additional commands, e-mail:
> user-help@struts.apache.org
> > 
> > 
> 
> 
> 
> 	
> 		
> __________________________________ 
> Yahoo! Mail - PC Magazine Editors' Choice 2005 
> http://mail.yahoo.com
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> For additional commands, e-mail:
> user-help@struts.apache.org
> 
> 



	
		
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

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


Re: cant reset form

Posted by Paul Benedict <pa...@yahoo.com>.
Pat,

It's possible by restarting the tomcat server, you're serializing the session -- it's called a
"sticky session" -- which sticks around between restarts. 

I am not aware of anyone using reset(). If you also need to clear the form fields, why not use a
request scope form? It sounds like you have your form in session scope so the last submit is
always in memory; set scope="request" on the <action> definition and this will solve it. 

--- Chris Pat <cp...@yahoo.com> wrote:

> Hello
> I have an app with three fields on the form.  It all
> works fine and I even have the Reset method assigning
> blank strings.  The problem, Reset never works.  I
> submit the form and the form values  do not clear. 
> This is even more unbelievable, I down TC, recompile
> the war, place it in webapps, start TC, and STILL the
> same values.  How can this happern, what am I clearly
> not doing?  
> 
> Also, If I wanted the form to keep a dynamic list per
> field of the values entered per session per form with
> the browser, is there an easy way to do that?  Thank you.
> 
> 
> 	
> 		
> __________________________________ 
> Yahoo! Mail - PC Magazine Editors' Choice 2005 
> http://mail.yahoo.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 



	
		
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

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