uCosminexus Application Server, Web Container Functionality Guide
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).
This subsection describes specifications where functionalities added in Servlet 3.0 and functionalities of Application Server are combined.
You cannot set the version to 3.0 in the Web application version setting functionality.
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.
Reloading of an application that uses Servlet 3.0 functionalities has the following constraints:
You cannot use the run-as functionality in a servlet defined by using an API. Settings are ignored if you:
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.
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.
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.
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.
You cannot use the @PostConstruct or @PreDestroy annotations in filters or listeners defined with APIs. Such annotations are ignored if used.
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.
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.
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:
When you define using the ServletContainerInitializer interface in Application Server, the following points differ from the Servlet 3.0 specifications:
webserver.ServletContainerInitializer_jar.include.path
Also, implementation class information of the ServletContainerInitializer interface, defined in the javax.servlet.ServletContainerInitializer file, is read as described below.
If you use the file upload functionality with Application Server, the following points differ from the Servlet3.0 specifications:
Table 6-14 Type of requests that execute file upload and the corresponding execution result
Request type specified in web.xml or @MultipartConfig annotation | Execution result |
---|---|
Other than mime-multipart | The javax.servlet.ServletException exception is thrown. |
mime-multipart other than multipart/form-data | The javax.servlet.ServletException exception is thrown. |
multipart/form-data | File upload is executed. No exception is thrown. |
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.
The following points differ from the Servlet 3.0 specifications if APIs are used with Application Server.
Table 6-15 Non-supported APIs (Servlet 3.0)
No. | Package | Class | Interface/Class | Method | Functionality |
---|---|---|---|---|---|
1 | javax.servlet | AsyncContext | Interface | All methods | Asynchronous servlet |
2 | AsyncListener | Interface | All methods | Asynchronous servlet | |
3 | ServletContext | Interface | getJspConfigDescriptor | JSP | |
4 | ServletRequest | Interface | startAsync | Asynchronous servlet | |
5 | isAsyncStarted | Asynchronous servlet | |||
6 | isAsyncSupported | Asynchronous servlet | |||
7 | getAsyncContext | Asynchronous servlet | |||
8 | getDispatcherType | Asynchronous servlet | |||
9 | AsyncEvent | Class | All methods | Asynchronous servlet | |
10 | ServletRequestWrapper | Class | startAsync | Asynchronous servlet | |
11 | isAsyncStarted | Asynchronous servlet | |||
12 | isAsyncSupported | Asynchronous servlet | |||
13 | getAsyncContext | Asynchronous servlet | |||
14 | getDispatcherType | Asynchronous servlet | |||
15 | Registration | Interface | setAsyncSupported | Asynchronous servlet | |
16 | javax.servlet.descriptor | JspConfigDescriptor | Interface | All methods | JSP |
17 | JspPropertyGroupDescriptor | Interface | All methods | JSP | |
18 | TaglibDescriptor | Interface | All methods | JSP |
You can omit web.xml in Servlet 3.0 for the following applications:
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.
You cannot use the following names for HTTP Cookies you use in a Web application. Note that the Cookie names are not case sensitive.
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.
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.
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.
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:
All Rights Reserved. Copyright (C) 2013, Hitachi, Ltd.