• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What is the purpose of scope attribute?

 
S Thanigaivel
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 141
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Brent Sterling
Ranch Hand
Posts: 948
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
  • 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
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic