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

ServletContext vs. PageContext  RSS feed

 
A Babu
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,
please give me the difference b/w servletcontext and pagecontext.

cheers,
babu.
 
Vishnu Prakash
Ranch Hand
Posts: 1026
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Using servletContext you can set attributes only at application scope Whereas using pageContext you can set attributes at any scope
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Vishnu Prakash:
Whereas using pageContext you can set attributes at any scope


??
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66186
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Adeel Ansari:


??


I believe he is referring to the fact that there is a method on PageContext that you can use to set a scoped variable into any of the scoped contexts. It's not really relevant to the orignal question though.
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Bear Bibeault:
I believe he is referring to the fact that there is a method on PageContext that you can use to set a scoped variable into any of the scoped contexts. It's not really relevant to the orignal question though.


Yeah, might be. It was ambiguous indeed.
 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by babu amara:
hi all,
please give me the difference b/w servletcontext and pagecontext.

cheers,
babu.


I think, there is no similarity between these two. ServletContext is for whole application and PageContext has all the scope objects and *some other objects also*...
 
A Babu
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,
thanks for answers.but no one cleared my doubt.but this is the question asked me in interviews.

please give solution.

cheers,
babu.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66186
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The scoped contexts are thoroughly described in the JSP 2.0 Specification in section JSP.1.8.2.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!