You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Mehmet E." <m_...@yahoo.com> on 2005/05/08 14:09:39 UTC

Session Scope-Form Bean Reset Method Executing Every Request

Form Bean scope is session. In every request form bean
RESET method is executing. I am useing struts with
tiles. There is no code for removing form bean from
session. As i know, it must execute one times per
session after creation of form bean.  

    <action input="site.abc.page" name="abcForm"
parameter="method" path="/abc/abcQuery"
scope="session" type="tr.abc.AbcAction">
      <forward name="self" path="site.abc.page"/>
    </action>

Thanks... 


		
__________________________________ 
Yahoo! Mail Mobile 
Take Yahoo! Mail with you! Check email on your mobile phone. 
http://mobile.yahoo.com/learn/mail 

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


Re: Session Scope-Form Bean Reset Method Executing Every Request

Posted by Aladin Alaily <st...@aladin.ca>.
Hi Mehmet,

The reset method of your form bean will be executed every time it passes 
through the controller on a redirect, which is handled as a new request. 
  As such, if you do not want to have the reset method called you should 
forward your pages rather than redirecting them (I don't think this is a 
good idea for forms).

An alternative, if you want to use redirect (which I would recommend to 
circumvent the form-resubmit prompt on reload or when navigating with 
the browser's back button), is to set your formbean in the session and 
reset it manually (when needed).

Hope this helps,
Aladin



Adam Hardy wrote:

> On 08/05/05 13:09&nbsp;Mehmet E. wrote:
> 
>> Form Bean scope is session. In every request form bean
>> RESET method is executing. I am useing struts with
>> tiles. There is no code for removing form bean from
>> session. As i know, it must execute one times per
>> session after creation of form bean.  
> 
> 
> Mehmet, I never used the formbean in session scope but I'm guessing that 
> reset is triggered once per request.
> 
> Logically the alternative request-scope form-bean needs no reset() 
> method, therefore the reset method must specifically exist to be 
> executed on session-scope formbeans on every request.
> 
> Someone correct me if I'm wrong - if you wanted you could check quickly 
> in the struts source code.
> 
> 
> Adam
> 


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


Re: Session Scope-Form Bean Reset Method Executing Every Request

Posted by Adam Hardy <ah...@cyberspaceroad.com>.
On 08/05/05 13:09&nbsp;Mehmet E. wrote:
> Form Bean scope is session. In every request form bean
> RESET method is executing. I am useing struts with
> tiles. There is no code for removing form bean from
> session. As i know, it must execute one times per
> session after creation of form bean.  

Mehmet, I never used the formbean in session scope but I'm guessing that 
reset is triggered once per request.

Logically the alternative request-scope form-bean needs no reset() 
method, therefore the reset method must specifically exist to be 
executed on session-scope formbeans on every request.

Someone correct me if I'm wrong - if you wanted you could check quickly 
in the struts source code.


Adam

-- 
struts 1.2 + tomcat 5.0.19 + java 1.4.2
Linux 2.4.20 Debian

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