uCosminexus Application Server, Web Container Functionality Guide

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

6.2.3 Precautions related to the specifications that are added or changed in the Servlet 3.0 specifications

This subsection describes precautions on using specifications that were added or changed in Servlet 3.0 for Application Server. For details on Servlet 3.0 and Servlet 2.5 specifications, see the respective specifications (Servlet 3.0 specifications and Servlet 2.5 specifications).

Organization of this subsection
(1) Specifications where Servlet 3.0 functionalities and Application Server functionalities are combined
(2) Collaborating Servlet 3.0 and CDI
(3) Combining filters or listeners defined by using an API with @PostConstruct or @PreDestroy annotations
(4) When there is no content to include
(5) Using escape sequence
(6) Defining dynamic servlets
(7) About file upload
(8) Deploying static resources
(9) About API
(10) Omitting the web.xml
(11) Changing an HTTP Cookie name that indicates a session ID
(12) HTTP Cookie names available in Web applications
(13) Class specified in the <servlet-class> element
(14) Class specified in the filter-class element
(15) Changing the Path attribute of an HTTP Cookie indicating a session ID
(16) Characters that can be used in the Path attribute and the Domain attribute of an HTTP Cookie indicating a session ID

(1) Specifications where Servlet 3.0 functionalities and Application Server functionalities are combined

This subsection describes specifications where functionalities added in Servlet 3.0 and functionalities of Application Server are combined.

(a) Functionality for setting the Web application version

You cannot set the version to 3.0 in the Web application version setting functionality.

(b) JSP pre-compile under META-INF/resources

Although it is now possible with Servlet 3.0 specifications to include JSP files in the hierarchy of the META-INF/resources inside a JAR file, you cannot execute JSP pre-compile for Web applications that have a JSP in the META-INF/resources hierarchy. If you execute the JSP pre-compile, the JSP in the META-INF/resources hierarchy is not pre-compiled, and an error occurs on executing the request.

(c) Reloading an application that uses Servlet 3.0

Reloading of an application that uses Servlet 3.0 functionalities has the following constraints:

(d) Using the run-as functionality in servlets defined by using API

You cannot use the run-as functionality in a servlet defined by using an API. Settings are ignored if you:

(e) Monitoring the execution time of servlets or filters defined by using APIs

You cannot use the execution time monitoring functionality of the J2EE application for the servlets or filters defined by using APIs. Even if you define the method-observation-timeout tag in the cosminexus.xml file, the tag is ignored.

(f) Continuation of the HTTP session when the Web application is invoked

The operation regarding the continuation of an HTTP session when the Web application is invoked is the same as in the case of Servlet 2.5 specifications. For details, see 6.2.4(6) Continuation of the HTTP session when the Web application is invoked.

(g) Request redirecting when the cookie name of the session is changed

When the Web container is deployed in a cluster configuration, you can distribute requests by using the Redirector. The Redirector references the session ID added to each request and distributes the requests in such a way that the requests from the same Web client are redirected to the same Web container. However, if you change the session cookie name from the default name JSESSIONID to some other name, requests from the same Web client might not be redirected to the same Web container.

(2) Collaborating Servlet 3.0 and CDI

When you want to combine Servlet 3.0 and CDI to use them together, use a web.xml that is compatible with Servlet 3.0. A web.xml of any other version cannot be used in combination with CDI.

(3) Combining filters or listeners defined by using an API with @PostConstruct or @PreDestroy annotations

You cannot use the @PostConstruct or @PreDestroy annotations in filters or listeners defined with APIs. Such annotations are ignored if used.

(4) When there is no content to include

In Servlet 3.0, default servlets (servlets provided by the container to provide static content) are included. If there is no content to be included, the system throws the FileNotFoundException exception. If the exception is not handled in the user program, the response is not committed and the status code 500 is returned.

Application Server does not support this specification. The same status code 404 as in versions prior to 08-70 is returned.

(5) Using escape sequence

Do not use an escape sequence (\b, \t, \n, \f, \r,\" ,\',\\)for input characters in API or the properties newly added in Servlet 3.0. If you use the escape sequence, new lines might get randomly added in the log thus affecting the layout of the log.

(6) Defining dynamic servlets

The following points describe how the behavior of dynamic servlets differs from the Servlet 3.0 specifications when the dynamic servlets are defined and used in Application Server:

(a) Defining servlets, filters, or listeners
(b) Defining by using the ServletContainerInitializer interface

When you define using the ServletContainerInitializer interface in Application Server, the following points differ from the Servlet 3.0 specifications:

Also, implementation class information of the ServletContainerInitializer interface, defined in the javax.servlet.ServletContainerInitializer file, is read as described below.

(7) About file upload

If you use the file upload functionality with Application Server, the following points differ from the Servlet3.0 specifications:

(8) Deploying static resources

This point describes the deployment of static resources and the points that differ from the Servlet 3.0 specifications when the static resources are used with Application Server.

(9) About API

The following points differ from the Servlet 3.0 specifications if APIs are used with Application Server.

(10) Omitting the web.xml

You can omit web.xml in Servlet 3.0 for the following applications:

(11) Changing an HTTP Cookie name that indicates a session ID

When changing the HTTP Cookie name that indicates the session ID, you cannot specify csfcfc in the Cookie name.

Also, the following are the conditions for the characters that you can use. If you violate these conditions, KDJE39559-W is output. This may also lead to incorrect operations of the session, therefore use the characters that conform to the conditions.

(12) HTTP Cookie names available in Web applications

You cannot use the following names for HTTP Cookies you use in a Web application. Note that the Cookie names are not case sensitive.

(13) Class specified in the <servlet-class> element

If you want to omit the servlet-class element in the web.xml, you must include the subclass of javax.servlet.http.HttpServlet in which you have specified the @WebServlet annotation in the Web application, and specify the name of the servlet for which you have omitted the servlet-class element in the name attribute. If, the corresponding HttpServlet class is not available, the KDJE39339-E message is output and the servlet class fails to load.

(14) Class specified in the filter-class element

If you want to omit the filter-class element in web.xml, you must include the implementation class of javax.servlet.Filter in which you have specified the @WebServlet annotation in the Web application, and specify the name of the filter for which you have omitted the filter-class element in the filterName attribute. If the corresponding Filter class is not available, the KDJE39340-E message is output and the application fails to start.

(15) Changing the Path attribute of an HTTP Cookie indicating a session ID

When you change the Path attribute of an HTTP Cookie indicating a session ID, and the HTTP Cookie name or the Path attribute indicating a session ID duplicates that of another Web application, the HTTP Cookie value indicating the session ID might be overwritten or deleted, and the HTTP session can no longer be inherited.

(16) Characters that can be used in the Path attribute and the Domain attribute of an HTTP Cookie indicating a session ID

Note that the following are the conditions for characters that can be used in the Path attribute and Domain attribute of an HTTP Cookie indicating a session ID. If the following conditions are not satisfied, the KDJE39559-W message is output. If you use invalid characters, it might result in an abnormal behavior of the session. Therefore, use characters that satisfy the following conditions: