| 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
Rancher
Joined: Apr 07, 2010
Posts: 1041
|
|
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.
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
|
 |
 |
|
|
subject: Life-cycle of PageContext object
|
|
|