uCosminexus Application Server, Web Container Functionality Guide

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

6.2.13 Precautions related to Web applications when migrating from a previous version of Application Server to 09-00

This subsection describes the precautions related to Web applications when migrating from a previous version of Application Server to 09-00.

Organization of this subsection
(1) Version information acquiring API supported by the Web Container
(2) Invocation of initCause(Throwable) for objects generated in javax.servlet.ServletException and javax.servlet.jsp.JspException
(3) Operations when the ServletConfig object maintained by the javax.servlet.GenericServlet class is null
(4) Log output by the init method and destroy method of the javax.servlet.GenericServlet class
(5) Log output by the init method and destroy method of the javax.servlet.GenericServlet class
(6) Searching the TLD file in the library JAR
(7) Searching the TLD file in the JAR file specified in the class path in the cjjspc command
(8) Deleting the HTTP Cookie indicating the session ID of the HTTP session

(1) Version information acquiring API supported by the Web Container

In the Servlet API listed in the following table, you can acquire the version information of the Servlet specifications supported by the Web Container.

Table 6-38 Version information acquiring API supported by the Web Container

Interface/Class name Method name
javax.servlet.ServletContext getMajorVersion
getMinorVersion
javax.servlet.jsp.JspEngineInfo getSpecificationVersion

Even if the Web application version is earlier than Servlet 2.5/JSP 2.0, the version of the servlet specifications supported by the Web container is Servlet 3.0/JSP 2.1. Accordingly, the servlet APIs described above return Servlet 3.0/JSP 2.1 as the servlet version. Note that the APIs retrieve information irrespective of the operating mode of the server.

(2) Invocation of initCause(Throwable) for objects generated in javax.servlet.ServletException and javax.servlet.jsp.JspException

You cannot invoke initCause(Throwable) for the following objects:

If you want to invoke initCause(Throwable), set up the compatibility properties in the Easy Setup definition file. For details on the settings, see 6.2.1 (22) Acquiring the root cause exception specified in the constructor of the javax.servlet.ServletException class.

Operations when the setCharacterEncoding method of the javax.servlet.ServletRequest interface is invoked

After invoking the getReader method of the javax.servlet.ServletRequest interface, if you invoke the setCharacterEncoding method of the javax.servlet.ServletRequest interface, the return value of the getCharacterEncoding method is not changed. For details, see 6.2.4 (8) Disabling the invocation of the setCharacterEncoding method of the javax.servlet.ServletRequest interface.

(3) Operations when the ServletConfig object maintained by the javax.servlet.GenericServlet class is null

If ServletConfig maintained by the javax.servlet.GenericServlet class as the instance variable is null, the exceptions thrown by the following methods differ in each version:

The exceptions thrown by these methods will be described below for each version.

Versions prior to 07-60
java.lang.NullPointerException

08-00 or later
java.lang.IllegalStateException
'ServletConfig has not been initialized.' is output as the exception message.

These exceptions are thrown when both the following conditions are fulfilled:

(4) Log output by the init method and destroy method of the javax.servlet.GenericServlet class

If you initialize or terminate the servlet that does not override the init method and destroy method of the javax.servlet.GenericServlet class, the log is output in the servlet log. For details on the log that is output, see 5.1.1(17) Messages output when the init method and destroy method are not overridden.

However, the operations when the ServletConfig that has the javax.servlet.GenericServlet class in the instance variable is null differ with the versions prior to 07-60 and with 08-00. The differences in operations in each version are described below.

Versions prior to 07-60
Log output fails and the java.lang.NullPointerException exception is thrown.

08-00 or later
An exception is not thrown. The log is also not output.

(5) Log output by the init method and destroy method of the javax.servlet.GenericServlet class

If you initialize or terminate the servlet that does not override the init method and destroy method of the javax.servlet.GenericServlet class, the log is output in the servlet log. For details on the log that is output, see 6.2.1 (17) Messages output when the init method and destroy method are not overridden.

However, the operations when the ServletConfig that has the javax.servlet.GenericServlet class in the instance variable is null differ with the versions prior to 07-60 and with 08-00or later. The differences in operations in each version are described below.

Versions prior to 07-60
Log output fails and the java.lang.NullPointerException exception is thrown.

08-00or later
An exception is not thrown. The log is also not output.

(6) Searching the TLD file in the library JAR

In 08-00or later, you can search the TLD file included in the library JAR and use the tag library present in the library JAR. If the library JAR contains the TLD file, you can use the TLD file that could not be used in the previous version, so the following operating changes occur:

For details, see 2.3.4 Storing the tag library in the J2EE applications.

(7) Searching the TLD file in the JAR file specified in the class path in the cjjspc command

In 08-00or later, during the JSP compilation using the cjjspc command, you can search the TLD file within the JAR file specified in the class path in the -classpath option and can use the tag library that exist within the JAR file. If the JAR file specified in the class path includes TLD files, you can use the TLD files that you could not use with the versions prior to the 07-60 version. As a result, the following events occur:

For details, see 2.3.4 Storing the tag library in the J2EE applications.

(8) Deleting the HTTP Cookie indicating the session ID of the HTTP session

When the HTTP session is disabled in the Web application, the operations for the HTTP Cookie information that the Web client maintains differ with the versions prior to the 07-60 version and in the 08-00 or later. The differences in operations for each version are as follows:

08-00 or later
The HTTP Cookie information that the Web client maintains is deleted. Also, the sending of the session ID for a disabled HTTP session is controlled.

Versions prior to 07-60
The HTTP Cookie information that the Web client maintains is not deleted. Therefore, even after the HTTP session is disabled, sending of the disabled session ID might continue.

For details on deleting the HTTP Cookie, see 2.7.4 Deleting invalid session IDs maintained by the Web client.

When performing upgrade installation from the versions prior to the 07-60 version and in the 08-00 or later, the settings for the following parameter are added to the settings of the already setup J2EE server:

webserver.session.delete_cookie.backcompat=true

By adding these settings, the HTTP Cookie information is no longer deleted and the operations are same as the versions prior to the 07-60 version. For details on the parameters, see 2.4 usrconf.properties (User property file for J2EE servers) in the uCosminexus Application Server Definition Reference Guide.