Java 2 Platform, Enterprise Edition: Platform and Component Specifications

Some details of what makes a JSP page legal are very specific to the scripting language used in the page. This is especially complex since scriptlets are just language fragments , not complete language statements.

JSP.4.1.1 Valid JSP Page

A JSP page is valid for a Java platform if and only if the JSP page implementation class defined by Table JSP.4-1 (after applying all include directives), together with any other classes defined by the JSP container, is a valid program for the given Java platform.

Sun Microsystems reserves all names of the form {_} jsp_* and {_} jspx_* , in any combination of upper- and lowercase, for the JSP specification. Names of this form that are not defined in this specification are reserved by Sun for future expansion.

Table JSP.4-1. Structure of the Java Programming Language Class

Optional imports clause as indicated via jsp directive

import name1

SuperClass is selected either by the JSP container or by the JSP author via jsp directive.

Name of class (_jspXXX) is implementation dependent.

class _jspXXX extends SuperClass

Start of body of JSP page implementation class

{

(1) Declaration Section

// declarations ...

Signature for generated method

public void _jspService(<ServletRequestSubtype> request, <ServletResponseSubtype> response) throws ServletException, IOException {

(2) Implicit Objects Section

// code that defines and initializes request, response, page, pageContext etc.

(3) Main Section

// code that defines request/response mapping

Close of _jspService method

}

Close of _jspXXX

}

JSP.4.1.2 Implementation Flexibility

The transformations described in this chapter need not be performed literally; an implementation may want to implement things differently to provide better performance, lower memory footprint, or other implementation attributes.

Категории