It's not a secret anymore!
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 Java Interview Guide this week in the Jobs Discussion 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 <
I agree. Here's the link:
subject: PageContext and ServletContext
It's not a secret anymore!