jspInit()
The 
jspInit()
 method is invoked when the JSP page is initialized. It is the 
responsibility of the JSP implementation (and of the class mentioned by the 
extends
attribute, if present) that at this point invocations to the 
getServletConfig
() 
method will return the desired value.
A JSP page can override this method by including a definition for it in a declaration 
element.
The signature of this method is 
void jspInit().
jspDestroy()
The 
jspDestroy
() method is invoked when the JSP page is about to be destroyed.
A JSP page can override this method by including a definition for it in a declaration 
element.
The signature of this method is 
void jspDestroy().
_jspService()
The 
_jspService
() method corresponds to the body of the JSP page. This method is 
defined automatically by the JSP container and should never be defined by the JSP 
page author.
If a superclass is specified using the 
extends
 attribute, that superclass may choose to 
perform some actions in its service() method before or after calling the _jspService() 
method. See Section 3.2.4.
The signature of this method is 
public void _jspService(HttpServletRequest request, 
HttpServletResponse response) throws ServletException, IOException.
6.1.2
JspWriter
The actions and template data in a JSP page is written using the 
JspWriter 
object that is 
referenced by the implicit variable 
out
. This variable is initialized by code generated 
automatically by the JSP container (see the 
PageContext
 object in Section 6.1.4). 
The initial 
JspWriter
 object is associated with the 
PrintWriter
 object of the 
ServletResponse
 in a way that depends on whether the page is or not buffered. If the 
page is not buffered, output written to this 
JspWriter 
object will be written through to 
the 
PrintWriter
 directly, which will be created if necessary by invoking the 
getWriter()
 method on the 
response
 object. But if the page is buffered, the 
PrintWriter 
object will not be created until when the buffer is flushed, and operations 
like 
setContentType()
 are legal. Since this flexibility simplifies programming 
substantially, buffering is the default for JSP pages.
Buffering raises the issue of what to do when the buffer is exceeded. Two approaches can be 
taken:
Exceeding the buffer is not a fatal error; when the buffer is exceeded, just flush the 
output.
Exceeding the buffer is a fatal error; when the buffer is exceeded, raise an exception.
115
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.