wood burning stoves 2.0*
The moose likes Struts and the fly likes What is the purpose of scope attribute? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "What is the purpose of scope attribute?" Watch "What is the purpose of scope attribute?" New topic
Author

What is the purpose of scope attribute?

S Thanigaivel
Ranch Hand

Joined: Oct 06, 2005
Posts: 60
Hi,

what is the purpose of scope attribute of action tag?

when scope is assigned request then the scope of form bean object is for that particular request alone. (if i am right)

what would be the scope of the form bean object if scope is session or application?

what does session and application mean in this context?

Thanks
Thanigaivel S.
vijay saraf
Ranch Hand

Joined: Jan 08, 2005
Posts: 141
The default scope is request,
when you set the scope as session then bean is available till session live.
if you you havn't set life time of session then untill you close your browser, bean is available.
while in case of application,bean is avaibale till application is running,irrespective of session it is avaible to all.


Thanks
Vijay Saraf.
Brent Sterling
Ranch Hand

Joined: Feb 08, 2006
Posts: 948
  • I am pretty sure that the only two values that you can set on your action mapping are "request" and "session".
  • The default is "session"
  • You seem to understand "request" scope
  • With "session" scope an instance of the form will be created when needed and stored in the session. This same instance will be reused between actions that use the same form name.

  • - Brent
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: What is the purpose of scope attribute?
     
    Similar Threads
    Bean Scope
    Related to Session and Request objects
    bean not found within request scope, but session scope
    bean problem
    how to use Session in Struts