aspose file tools
The moose likes Servlets and the fly likes Accessing a JSP's impleicit object pageContext in a Servlet? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Servlets
Reply Bookmark "Accessing a JSP Watch "Accessing a JSP New topic
Author

Accessing a JSP's impleicit object pageContext in a Servlet?

Alok Pota
Ranch Hand

Joined: Mar 07, 2001
Posts: 185
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
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
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?
 
Threads others viewed
How does a JSP inherit getServletContext() & getServletConfig methods?
Tag Files and jsp implicit objects
difference between PageContext and Page object
Help needed in useBean standard action
Page Context
MyEclipse, The Clear Choice