Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

doubt in page scope  RSS feed

 
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what actually do we mean by page scope
can attribute set in one jsp at page scope be access by another jsp?
 
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It depends.
A page is a translation unit ( a servlet ) and the page scope is related only about that unit. Only If you do a static import of a jsp you can access page scope attributes in the imported jsp, but not if you use forward or include since there would be different servlets.
I guess page Scope is primarily used to share attributes between tags and jsp..
 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think attributes set in one jsp page cannot be accessed in other jsp page because we are setting them for page scope.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!