Previous | Home | Next |
JSP API are two packages define as follows :
- javax.servlet.jsp
- javax.servlet.jsp.tagext
In JSP API define javax.servlet.jsp package with two interfaces and classes.The two interfaces are as follows:
- JspPage
- HttpJspPage
And its classes are as follows:
- JspWriter
- PageContext
- JspFactory
- JspEngineInfo
- JspException
- 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
- public void jspInit():
- public void jspDestroy():
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.
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:
- public void _jspService():
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 |