3.2.2
Request and Response Parameters
As shown in 
TABLE 3 1
, the methods in the contract between the JSP container and the JSP 
page require request and response parameters.
The formal type of the request parameter (which this specification calls 
) is an interface that extends 
javax.servlet.ServletRequest
. The interface must define a protocol dependent 
request contract between the JSP container and the class that implements the JSP page.
Likewise, the formal type of the response parameter (which this specification calls 
) is an interface that extends 
javax.servlet.ServletResponse
. The interface must define a protocol dependent 
response contract between the JSP container and the class that implements the JSP page.
The request and response interfaces together describe a protocol dependent contract between 
the JSP container and the class that implements the JSP page. The contract for HTTP is 
defined by the 
javax.servlet.http.HttpServletRequest
 and 
javax.servlet.http.HttpServletResponse
 interfaces.
The 
JspPage
 interface refers to these methods, but cannot describe syntactically the 
methods involving the 
Servlet(Request,Response)
 subtypes. However, interfaces for 
specific protocols that extend 
JspPage
 can, just as 
HttpJspPage
 describes them for the 
HTTP protocol.
Note   
JSP containers that conform to this specification (in both JSP page 
implementation classes and JSP container runtime) must implement the 
request
 and 
response
 interfaces for the HTTP protocol as described in this section.
3.2.3
Omitting the 
extends
 Attribute
If the 
extends
 attribute of the 
language
 directive (see Section 2.7.1,  The page 
Directive ) in a JSP page is not used, the JSP container can generate any class that satisfies 
the contract described in 
TABLE 3 1
 when it transforms the JSP page.
In the following code examples, 
CODE EXAMPLE 3 1
 illustrates a generic HTTP superclass 
named 
ExampleHttpSuper
. 
CODE EXAMPLE 3 2
 shows a subclass named _
jsp1344
 that 
extends 
ExampleHttpSuper
 and is the class generated from the JSP page. By using 
separate 
_jsp1344
 and 
ExampleHttpSuper
 classes, the JSP page translator needs not 
discover if the JSP page includes a declaration with 
jspInit()
 or 
jspDestroy();
 this 
simplifies very significantly the implementation.
Chapter 3
The JSP Container
76




JSP Web Hosting JavaServer Pages Specifications JSP Hosting




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