This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Life-cycle of PageContext object Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Life-cycle of PageContext object" Watch "Life-cycle of PageContext object" New topic
Author

Life-cycle of PageContext object

Kevin Kilbane
Ranch Hand

Joined: Sep 22, 2008
Posts: 42
Hi. I'm slightly confused by the pageContext implicit variable in a JSP.

What relationship does the PageContext object have with a JSP, a request etc.? Is there one PageContext object per JSP or one per execution of the JSP or something else?

There doesn't seem to be a PageContext object available in a servlet - is that right?

I've had a look at the API and a search in google but I'm still not 100% clear.

Thanks in advance.
Frits Walraven
Creator of Enthuware JWS+ V6
Saloon Keeper

Joined: Apr 07, 2010
Posts: 2007
    
  39

Hi Kevin,

According to the jsp2.0 spec:
JSP.1.8.4 The pageContext Object
A PageContext is an object that provides a context to store references to objects
used by the page, encapsulates implementation-dependent features, and provides
convenience methods.

So you have one PageContext per JSP, per execution of the JSP.

There doesn't seem to be a PageContext object available in a servlet - is that right?

Yes, that is to seperate ModelViewControl (MVC).

Regards,
Frits
Kevin Kilbane
Ranch Hand

Joined: Sep 22, 2008
Posts: 42
OK, thanks for the reply Frits
 
Have you checked out Aspose?
 
subject: Life-cycle of PageContext object
 
It's not a secret anymore!