Hi,
    Essentially, the form bean is the model for the web tier.
It's state can be associated with a certain request, in this case,
it will be stored as a request-scope attribute. If it's state is 
associated with a certain user/session, then it will be stored as
a session-scope attribute.
    Categorizing state into different scopes, namely request, session and
context will best reflect its nature and allow the servlet container to
manage(instantiate/use/destroy) accordingly. Form bean is just one of
this kind of state.

Hope this helps,
Shengmeng Liu

----- Original Message ----- 
From: "Chen, Yong" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Sent: Tuesday, January 08, 2002 11:43 PM
Subject: RE: scope for form beans


> what if one of your forms is never used in a session?
> and with session level bean, how would you know the form bean doesn't
> contain old data? form is request based not session based. you can certainly
> store some info. from the form in the session.
> 
> yc
> 
> 
> -----Original Message-----
> From: Kuntz Peter, NY [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, January 08, 2002 7:29 AM
> To: [EMAIL PROTECTED]
> Subject: scope for form beans
> 
> 
> Hi,
> 
> what are the motivations for having a request or session scoped form bean.
> As far as I could see in the struts source code a request scoped form bean
> is instantiated newly for every request. What are the reasons for that. Why
> shouldn't a form bean always exist during the time the session exists?
> 
> peter
> DISCLAIMER: The information in this message is confidential and may be
> legally privileged. It is intended solely for the addressee.  Access to this
> message by anyone else is unauthorised.  If you are not the intended
> recipient, any disclosure, copying, or distribution of the message, or any
> action or omission taken by you in reliance on it, is prohibited and may be
> unlawful.  Please immediately contact the sender if you have received this
> message in error. Thank you
> 
> --
> To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> 
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
> 



Reply via email to