This week's book giveaway is in the Big Data forum.
We're giving away four copies of Elasticsearch in Action and have Radu Gheorghe & Matthew Lee Hinman on-line!
See this thread for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes PageContext and ServletContext Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "PageContext and ServletContext" Watch "PageContext and ServletContext" New topic

PageContext and ServletContext

Saurabh Naik
Ranch Hand

Joined: Apr 24, 2008
Posts: 87
I am just confused in PageContext and ServletContext... how it is usefulll ?

SCJP 6 (88%), SCWCD 5 (78%), preparing for SCBCD
Oscar Costa
Ranch Hand

Joined: Feb 05, 2009
Posts: 31


It's about Scope:
The ServletContext has the application scope, it contains objects presents in all the servlet life cycle, like configuration parameters presents on deployment descriptor...
And the PageContext is just for the jsp. But it have an add where you can get/set attributes from any scope. See the specification:

"Do or do not... there is no try!" - Jedi Master Yoda
> SCJP 5 : SCWCD 5 : SCBCD 5 <
It is sorta covered in the JavaRanch Style Guide.
subject: PageContext and ServletContext