Accessing a JSP's impleicit object pageContext in a Servlet?
Alok Pota
Ranch Hand
Joined: Mar 07, 2001
Posts: 185
posted
0
Is there a way I can get access to a JSP's built-in variable pageContext in a servlet? Also is there a difference between the implciti object page & pageContext
Madhu Juneja
Ranch Hand
Joined: Mar 10, 2001
Posts: 176
posted
0
A Jsp is converted to a servlet. Hence this pageContext is very much accessible in the servlet (in the service method as it a local variable to the service method) page is equivalent to 'this' variable and pageContext refers to any context that this current page references for eg pageContext has various methods such as getServletConfig(), getSession(), getOut(), getServletContext() methods that a developer can make use of.
Peter den Haan
author
Ranch Hand
Joined: Apr 20, 2000
Posts: 3252
posted
0
Originally posted by Alok Pota: Is there a way I can get access to a JSP's built-in variable pageContext in a servlet?
In a servlet there is no PageContext (unless it's a compiled JSP of course). What do you find in PageContext that you cannot find in HttpRequest or ServletContext? - Peter
subject: Accessing a JSP's impleicit object pageContext in a Servlet?