JSP Tutorials

JSP API
Previous Home Next
adplus-dvertising

JSP API are two packages define as follows :

  1. javax.servlet.jsp
  2. javax.servlet.jsp.tagext

In JSP API define javax.servlet.jsp package with two interfaces and classes.The two interfaces are as follows:

  1. JspPage
  2. HttpJspPage

And its classes are as follows:

  1. JspWriter
  2. PageContext
  3. JspFactory
  4. JspEngineInfo
  5. JspException
  6. JspError

The JspPage interface

In JSP is generated a servlet classes that implemented the JspPage interface and extends with the Servlet interface. JSP API is provided two type of life cycle methods.

Some other type of methods of JspPage interface are used

  1. public void jspInit():
  2. It is invoked only once during the life cycle of the JSP when JSP page is requested firstly. It is used to perform initialization. It is same as the init() method of Servlet interface.

  3. public void jspDestroy():
  4. It is invoked only once during the life cycle of the JSP before the JSP page is destroyed. It can be used to perform some clean up operation.

The HttpJspPage interface

It is providing that only one life cycle method of JSP and which is extends by the JspPage interface.

Use method of HttpJspPage interface:

  1. public void _jspService():
  2. It is invoked each time when request for the JSP page comes to the container. It is used to process the request. The underscore _ signifies that you cannot override this method.

Previous Home Next