You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Caroline Jen <ji...@yahoo.com> on 2006/08/10 19:32:37 UTC

clear vs. reset

When a session ends, all data submitted have to be
cleared.

My form bean is in a session.  I want to re-use the
submitted data during the session.

It seems that if I have the 'reset' method in my form
bean, the submitted data are lost when I want to
re-use the data.  

What are the differences between the 'clear' method
and the 'reset' method?

Thanks for your advice.

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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


Re: clear vs. reset

Posted by Martin Gainty <mg...@hotmail.com>.
My simple explanation
Reset is supposed to reset all of the form fields to their original default values
Clear is supposed to clear all of the form fields

Anyone else?
Martin --
*********************************************************************
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.



----- Original Message ----- 
From: "Adam Gordon" <ad...@readytalk.com>
To: "Struts Users Mailing List" <us...@struts.apache.org>
Sent: Thursday, August 10, 2006 1:46 PM
Subject: Re: clear vs. reset


> Caroline-
> 
> I can't speak for clear vs. reset, but if you look at the default 
> implementation of reset(...), it doesn't do anything - you have to 
> override it in your form bean to have it do anything.
> 
> However, if you want to persist the data, you can set an attribute on 
> the session and it will be available everywhere.
> 
> Hope that helps.
> 
> -Adam
> 
> Caroline Jen wrote:
>> When a session ends, all data submitted have to be
>> cleared.
>>
>> My form bean is in a session.  I want to re-use the
>> submitted data during the session.
>>
>> It seems that if I have the 'reset' method in my form
>> bean, the submitted data are lost when I want to
>> re-use the data.  
>>
>> What are the differences between the 'clear' method
>> and the 'reset' method?
>>
>> Thanks for your advice.
>>
>> __________________________________________________
>> Do You Yahoo!?
>> Tired of spam?  Yahoo! Mail has the best spam protection around 
>> http://mail.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: clear vs. reset

Posted by Adam Gordon <ad...@readytalk.com>.
Caroline-

I can't speak for clear vs. reset, but if you look at the default 
implementation of reset(...), it doesn't do anything - you have to 
override it in your form bean to have it do anything.

However, if you want to persist the data, you can set an attribute on 
the session and it will be available everywhere.

Hope that helps.

-Adam

Caroline Jen wrote:
> When a session ends, all data submitted have to be
> cleared.
>
> My form bean is in a session.  I want to re-use the
> submitted data during the session.
>
> It seems that if I have the 'reset' method in my form
> bean, the submitted data are lost when I want to
> re-use the data.  
>
> What are the differences between the 'clear' method
> and the 'reset' method?
>
> Thanks for your advice.
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.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