JSP Page Implicit Object

Introduction:

1.    The JSP implicit page object is an instance of the java.lang.Object class. It represents the current JSP page.
2.    That is, it serves as a reference to the java servlet object that implements the JSP page on which it is accessed. It is not recommended to us this because it consumes large memory.
3.     The page object works like “this” key word in java.
4.     In the generated servlet, the variable is declared as follows
     Object page = this;
Parent reference can be used to hold child class object but, by using that reference we are allow to call only the methods available in the parent class.

Note : page cannot be used to directly call the servlet methods
·       page.getServletInfo()
·       Error because page is java.lang.Object type
·        ((servlet)page).getServletInfo()
·        this.getServletInfo()

Thanks For Making This Possible! Kindly Bookmark and Share it.

Technorati Digg This Stumble Stumble Facebook Twitter

No comments:

Post a Comment