A JSP page implementation class may depend on some support classes; if it does, and the 
JSP page implementation class is packaged into a WAR, those classes will have to be 
included in the packaged WAR so it will be portable across all JSP containers.
A JSP page author writes a JSP page expecting that the client and the server will 
communicate using a certain protocol. The JSP container must then guarantee that requests 
from and responses to the page use that protocol. Most JSP pages use HTTP, and their 
implementation classes must implement the 
HttpJspPage
 interface, which extends 
JspPage
. If the protocol is not HTTP, then the class will implement an interface that 
extends 
JspPage
.
3.2.1
API Contracts
The contract between the JSP container and a Java class implementing a JSP page 
corresponds to the 
Servlet
 interface; refer to the Servlet specification for details.
The contract between the JSP container and the JSP page author is described in 
TABLE 3 1
. 
The responsibility for adhering to this contract rests only on the JSP container 
implementation if the JSP page does not use the 
extends
 attribute of the 
jsp 
directive; 
otherwise, the JSP page author guarantees that the superclass given in the extends attribute 
supports this contract.
TABLE 3 1 
How the JSP Container Processes JSP Pages
Comments
Methods the JSP Container Invokes
Method is optionally defined in JSP page.
void 
jspInit
()
Method is invoked when the JSP page is 
initialized.
When method is called all the methods in 
servlet, including getServletConfig() are 
available
Method is optionally defined in JSP page.
void 
jspDestroy
()
Method is invoked before destroying the 
page.
Method may 
not
 be defined in JSP page.
void _
jspService
(, 
The JSP container automatically 
) throws 
generates this method, based on the 
contents of the JSP page.
IOException, ServletException
Method invoked at each client request.
75
JavaServer Pages 1.1 Specification  
November 30, 1999




JSP Web Hosting JavaServer Pages Specifications JSP Hosting




 
TotalRoute.net Business web hosting division of Vision Web Hosting Inc. All rights reserved.