uCosminexus Application Server, Web Container Functionality Guide

[Contents][Glossary][Index][Back][Next]

6.2.8 Precautions related to added and changed specifications in the JSP 2.0 specifications

This subsection describes the precautions for using the specifications that were added and changed in JSP 2.0 on the application server. For details on the JSP 2.0 specifications and JSP 1.2 specifications, see the respective specifications (JSP 2.0 specifications and JSP 1.2 specifications).

Organization of this subsection
(1) Default extension of JSP documents
(2) Output destination of the Java source files and class files of the tag file
(3) Multiple assignment of evaluation API functions for JSP EL expression
(4) JSP files and tag files coded in the XML syntax
(5) Deprecated isThreadSafe attribute of the page directive
(6) Default ContentType value of HTTP response in JSP documents
(7) Deploying the tag library descriptor (TLD file)
(8) XML view information that can be acquired with the getInputStream method of the javax.servlet.jsp.tagext.PageData class
(9) Default character coding of files included in the include directive
(10) Conflicting character codes in the JSP documents
(11) Default value of HTTP response character code in the JSP documents
(12) Specification of multiple pageEncoding attributes of the page directive
(13) When uri that is not registered in the taglib map is described in the tag library declaration of the JSP document
(14) Character code in JSP documents
(15) Escape sequence of EL (Expression Language)
(16) Type of EL evaluation results

(1) Default extension of JSP documents

In the JSP 2.0 specifications, the standard extension of JSP documents is jspx. In the Web Container used on the application server, a file with extension jspx is handled as a JSP document even if URL mapping is not defined in web.xml using default mapping.

(2) Output destination of the Java source files and class files of the tag file

Like a JSP file, Java source files and class files are generated by JSP compilation for a tag file. The Java source files and class files are output in the directory to output the JSP compilation result.

You can change the directory to output the JSP compilation result. Note that you must change the output destination directory when the path of the generated Java source files and class files exceeds the upper limit for the OS.

For details on the directory to output the JSP compilation result, see 2.5.5(2) Output destination of JSP compilation results when the JSP pre-compilation functionality is used and see 2.5.6(3) Output destination of JSP compilation results when the JSP pre-compilation functionality is not used.

(3) Multiple assignment of evaluation API functions for JSP EL expression

In the JSP 2.0 specifications, the following API functions are provided as the API functions for performing the syntax analysis and evaluating the EL expression:

In the JSP 2.0 specifications, you cannot specify multiple EL expressions from these API functions, but in the application server, you can specify multiple EL expressions.

(4) JSP files and tag files coded in the XML syntax

(5) Deprecated isThreadSafe attribute of the page directive

The isThreadSafe attribute of the page directive is deprecated in the JSP 2.0 specifications since the javax.servlet.SingleThreadModel interface is deprecated.

In the application server, you can use the isThreadSafe attribute of the page directive regardless of the Web application version. However, in the Servlet 2.4 specifications, note the cause due to which the javax.servlet.SingleThreadModel interface is deprecated, and then use.

(6) Default ContentType value of HTTP response in JSP documents

In JSP 2.0 specifications, a postscript has been added that the when the JSP document is used, the value of the default ContentType is text/xml.

In the application server, text/xml is operated as the default value in JSP 2.0 and later versions and text/html is operated as the default value in JSP 1.2.

(7) Deploying the tag library descriptor (TLD file)

In the JSP 2.0 specifications, the provisions regarding the deployment location of the tag library descriptor is added.

In the application server, the KDJE39289-W message may be output when the Web application starts and during JSP compilation depending on the directory deployed. However, the Web application is executed without an error.

The message output conditions are described below:

Deployed directory
  • Not under /WEB-INF directory
  • Under /WEB-INF/classes directory
  • Under /WEB-INF/lib directory

The time when the message is output
  • When the applicable tag library descriptor is specified in the <taglib><taglib-location> tag of web.xml and the Web application is started
  • When compiling JSP that directly specifies and uses the applicable tag library descriptor in the tag library declaration

(8) XML view information that can be acquired with the getInputStream method of the javax.servlet.jsp.tagext.PageData class

The specifications of the XML view information that can be acquired with the getInputStream method of the javax.servlet.jsp.tagext.PageData object were changed in the JSP 2.0 specifications. The getInputStream method is specified and used in the third argument of the validate method of the javax.servlet.jsp.tagext.TagLibraryValidator class.

The changes in the application server are described as follows for the JSP 2.0 and later versions and JSP 1.2:

(a) jsp:id attribute

JSP 2.0 and later versions
The jsp:id attribute is added.

JSP 1.2
The jsp:id attribute is not added.
(b) Character encoding of XML view

JSP 2.0 and later versions
The character encoding of XML view is always considered as UTF-8, the character code is considered as UTF-8, and the XML declaration is output.

JSP 1.2
The character encoding of XML view is always considered as UTF-8, the character code is considered as UTF-8, and the XML declaration is not output.
(c) pageEncoding attribute of the page directive

JSP 2.0 and later versions
The value of the pageEncoding attribute is set in UTF-8. If the pageEncoding attribute does not exist, the pageEncoding attribute is added.

JSP 1.2
The value of the pageEncoding attribute is not changed.
(d) contentType attribute of the page directive

JSP 2.0 and later versions
Set the value set in the setContentType method of the ServletResponse class in the value of the contentType attribute. If the contentType attribute does not exist, the contentType attribute is added.

JSP 1.2
The value of the contentType attribute is not changed.

(9) Default character coding of files included in the include directive

In the JSP 2.0 specifications, a postscript has been added that the pageEncoding attribute of the page directive is only applied to the file that describes the pageEncoding attribute.

In the application server, regardless of the Web application version, if the character code is not specified in the include destination file while including the file in the include directive, the character code at the include source is applied to the include destination file.

(10) Conflicting character codes in the JSP documents

The specifications when the character code specified for the XML declaration in the JSP document differs from the character code specified in the pageEncoding attribute of the page directive in the JSP document, have been added in the JSP 2.0 specifications. This description is not present in the JSP 1.2 specifications.

The control when the character codes in the application server are different will be separately described for JSP 2.0 and later versions and JSP 1.2.

JSP 2.0 and later versions
A translation error occurs.

JSP 1.2
The pageEncoding attribute of the page directive is used.

(11) Default value of HTTP response character code in the JSP documents

The default character code of HTTP response used when the contentType attribute of the page directive does not exist in the JSP document and when the CHARSET value does not exist in the attribute has been added in the JSP 2.0 specifications.

The default value in the application server will be separately described for JSP 2.0 and later versions and JSP 1.2.

JSP 2.0 and later versions
UTF-8 is used.

JSP 1.2
ISO-8859-1 is used.

(12) Specification of multiple pageEncoding attributes of the page directive

The specifications for multiple pageEncoding attributes of the page directive are changed in the JSP 2.0 specifications.

In JSP 2.0 specifications, multiple pageEncoding attributes can be specified for each translation (files included in the JSP and include directive). A specification was also added that if multiple pageEncoding attributes are specified in the same JSP file, a compilation error occurs.

In the application server, regardless of the Web application version, you can specify multiple pageEncoding attributes in each translation. In this case, the value specified in each file is applied to the applicable file. Also, the specification of multiple pageEncoding attributes in the same JSP file differs in the JSP 2.0 and later versions and in JSP 1.2. The specifications in the application server will be described separately for JSP 2.0 and later versions and for JSP 1.2.

JSP 2.0 and later versions
The pageEncoding attribute can be specified only once in one file. If multiple pageEncoding attributes are specified, a compilation error occurs.

JSP 1.2
Multiple pageEncoding attributes can be specified in one file. The value described first is applied.

(13) When uri that is not registered in the taglib map is described in the tag library declaration of the JSP document

Specifications were added in the JSP 2.0 specifications for the operations when the tag library is declared in the JSP document using the name space and the specified uri is not found in the taglib map (mapping of the uri and tag library descriptor).

The operations in the application server will be described separately for JSP 2.0 and later versions and JSP 1.2.

JSP 2.0 and later versions
If the specified uri is not registered in the taglib map, the action defined in the uri name space is handled without being analyzed (output as text).

JSP 1.2
  • When the uri is an absolute URI
    A translation error occurs.
  • When the uri is not an absolute URI
    The TLD file (tag library descriptor) is searched and used as the path in the Web application. If the TLD file does not exist, a translation error occurs.

(14) Character code in JSP documents

The method for determining the file character code in the JSP document was changed in the JSP 2.0 specifications.

The method for determining the character code in the application server will be described separately for JSP 2.0 and later versions and JSP 1.2.

JSP 2.0 and later versions
The XML declaration is followed according to the XML 1.0 specifications. If the XML declaration is not present, the default value is UTF-8.

JSP 1.2
The pageEncoding attribute of the page directive is followed. If the pageEncoding attribute does not exist, the character code specified in the contentType attribute charset= is followed. If both do not exist, the default value is ISO-8859-1.

(15) Escape sequence of EL (Expression Language)

The JSP specifications and the specifications for the Web Container used in the application server are described below for the JSP 2.0 specification of escape sequence that expresses "$" included in "${", indicating the start of EL, as a string.

In the Web Container used on the application server, "\$" is output as "$" using the escape sequence. If you want to output "\$", code as "\\$".

The operations when "\$" is coded will be described separately for JSP 2.0 and JSP 1.2.

JSP 2.0
In the JSP 2.0 specifications, if the EL settings are disabled, "$" need not be considered as the starting character of EL and "\" is not handled as a control code. When operating in JSP 2.0, the output result of "\$" differs depending on whether the EL settings are enabled. The following table describes the output results of "\$" when the operations are performed in JSP 2.0.

Table 6-36 Output results of "\$" when the operations are performed in JSP 2.0

Enabling/ Disabling of EL settings Specifications Output results
Enabled JSP 2.0 specifications "$"
Web Container used in the application server "$"
Disabled JSP 2.0 specifications "\$"
Web Container used in the application server "$"
To disable the EL settings, use one of the following methods:
  • Specify true in the isELIgnored attribute of the page directive.
  • Specify true in the isELIgnored attribute of the tag directive.
  • Specify true in the <el-ignored> tag of web.xml.

JSP 1.2
In the JSP 1.2 specifications, "$" is not a reserved word. "\" is not handled as a control code, therefore, "\$" is output as "\$".
In the Web Container used in the application server, "\" is handled as a control code even when operations are performed in JSP1.2, so "\$" is output as "$". However, when "\$" is used in the attribute value of the JSP document format, "\$" is output as "\$".
The following table describes the output result of "\$" when operations are performed in JSP 1.2.

Table 6-37 Output result of "\$" when operations are performed in JSP 1.2

Specifications Output results
JSP 1.2 specifications "\$"
Web Container used in the application server "$"

(16) Type of EL evaluation results

The JSP specifications and application server specifications for the type of EL evaluation results specified in the custom tag attribute are described below.

JSP 2.0 specifications
The EL evaluation result is converted to the expected type of custom tag attribute.

Application server
The EL evaluation result is converted to the type of the setter method argument corresponding to the custom tag attribute. The type element defined in the TLD attribute is not used for type conversion.
If the description location of EL is the tag file, the EL evaluation result is converted to the type specified in the type attribute of the attribute directive.

The examples when the types of EL evaluation results differ in the JSP specifications and the application server are described below.

Example:
  • Custom tag attribute name: attr
  • Signature of the custom tag setter: void setAttr(java.lang.String hoge)
  • Value of type element of the attr attribute in TLD: java.lang.Integer

In this example, the type of EL evaluation result is as follows:

JSP 2.0 specifications
The type is converted to java.lang.Integer.

Application server
The type is converted to java.lang.String.