Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Regarding Implicit Objects

 
yekkala krishna
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what is the difference between page and pagecontext implicit objects in JSP ?
 
Rao Raghu
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The implicit page variable is simply a "this" reference to the JSP instance that is being invoked by the servlet container. This is an object provided by the container that fulfils the JspPage interface, and normally the HttpJspPage interface too. These interfaces are similar to the Servlet and HttpServlet interfaces and implement JSP lifecycle methods jspInit, jspDestroy and _jspService(HttpServletRequest, HttpServletResponse).

The JSP pageContext variable refers to an object that implements the PageContext interface. The page context has convenience methods to access common Web application variables, including the servlet configuration and context objects, request and response objects, request attributes, and session object.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic