4.2
Declarations Section
The declarations section correspond to the declaration elements.
The contents of this section is determined by concatenating all the declarations in the page in 
the order in which they appear.
4.3
Initialization Section
This section defines and initializes the implicit objects available to the JSP page. See 
Section 2.8,  Implicit Objects .
4.4
Main Section
This section provides the main mapping between a request and a response object.
The contents of code segment 2 is determined from scriptlets, expressions, and the text body 
of the JSP page. These elements are processed sequentially; a translation for each one is 
determined as indicated below, and its translation is inserted into this section. The translation 
depends on the element type:
1.
Template data
 is transformed into code that will place the template data into the stream 
currently named by the implicit variable 
out
. All white space is preserved.
Ignoring quotation issues and performance issues, this corresponds to a statement of the 
form:
out.print(
template
);
2. A 
scriptlet
 is transformed into its Java statement fragment.
3. An 
expression
 is transformed into a Java statement to insert the value of the expression, 
converted to 
java.lang.String
 if needed, into the stream currently named by the 
implicit variable 
out
. No additional newlines or space is included.
Ignoring quotation and performance issues, this corresponds to a statement of the form:
out.print(
expression
);
Chapter 4
Scripting
84




JSP Web Hosting JavaServer Pages Specifications JSP Hosting




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