• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

why we need page scope

 
vijay saraf
Ranch Hand
Posts: 141
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All ,

if i declare a bean in a jsp then by default it will be visible to that page,then setting scope as page;what addition functionalties will adds to it.i just mean to ask what addtional functionalties are there in page scope that are not with default( means no scope).

Thanks,
Vijay Saraf.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Default is page scope, not "no scope".
You will use a page scope when some information does not need to be used outside the current page.
 
vijay saraf
Ranch Hand
Posts: 141
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That is fine.
but suppose i am not defining any scope in <jsp:useBean> then still that bean instance is avialable any where in that page.
and again if i define scope as page then the visibility of bean is same.
i just wanted to know is there any diffrence or not.

Thanks,
Vijay Saraf.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you read the spec about <jsp:useBean> ?
If you do not explicitly set the scope to scope="page", then default is scope="page". No difference.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic