Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

use of pageContext  RSS feed

 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why anyone except container would use pageContext to get other scope???

Thanks.
 
Manesh Kumar
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When you write custom tag library, it is not possible to get other scope without using pageContext object.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66188
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How else could a page access scoped variables in the various scopes?
 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Bear Bibeault:
How else could a page access scoped variables in the various scopes?


Doesn't page have access to all scope??

I mean, can't we access request/session in a page without pageContext??

Thanks.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66188
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As a convenience the JSP container creates implicit scripting variablse to the various scopes, but pageContext is the only way to access context information from custom tags and other non-scriptlet contexts.

It's also an important construct for accessing information from the EL.
[ May 22, 2006: Message edited by: Bear Bibeault ]
 
geeta lalchandani
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this link will help u rathi ji
there is a diff in the page and pageContext..


http://www.coderanch.com/t/289347/JSP/java/pageContext-why
 
vidya sagar
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Geetu

For a wonderful discussion link to know difference between page and pageContext
 
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!