uCosminexus Application Server, Web Container Functionality Guide

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

2.2.2 Notes when deploying and un-deploying web applications

This subsection describes the points to be considered when deploying and un-deploying a Web application.

Organization of this subsection
(1) Default mapping of servlets or JSPs
(2) Default values when tags in the DD (WEB-INF/web.xml) are not set
(3) Number of instances created for a servlet
(4) Timing to execute the init method and service method of servlets
(5) Servlet buffer used for sending a response
(6) Parsing the query character string

(1) Default mapping of servlets or JSPs

The setting that specifies which servlet will be invoked for the URL requested by the client is called Servlet mapping. The Java servlet specification requires the servlet mapping to be coded in the DD (WEB-INF/web.xml).

On the other hand, the mapping defined by default in a Web container is called default mapping. In a Web container, the following mapping is defined by default:

Table 2-3 Default mapping of servlets or JSPs defined in a Web container

URL Handling
*.jsp Treated as a JSP file.
*.jspx The Web applications compliant with Servlet 2.4 or later specifications are considered as the JSP documents. Note that the Web applications compliant with the Servlet 2.2 and Servlet 2.3 specifications are considered as the static contents.
/servlet/* The classes of the servlet in the JAR file deployed under WEB-INF/classes or WEB-INF/lib are executed. The executed servlet is searched by the servlet name.
When the '*' part of the URL is not defined as the servlet name, the servlet class is searched. In the '*' part of the URL, you can specify either the fully qualified class name of the servlet or the servlet name defined in web.xml.
When the fully qualified class name of the servlet is specified, the specified servlet is executed. When the servlet name is specified, the servlet defined in web.xml is executed.

Note that for the servlet, web.xml must include mapping definition, and if web.xml is omitted, the default mapping of the servlet will not be enabled for the Web applications.


For the default mapping of the servlet, specify either enabled or disabled in the following parameter in the <configuration> tag of the logical J2EE server (j2ee-server) in the Easy Setup definition file. By default, the default mapping of the servlet is disabled.

webserver.container.servlet.default_mapping.enabled

For details on the Easy Setup definition file and the parameters to be specified, see 4.6 Easy Setup definition file in the uCosminexus Application Server Definition Reference Guide.

(2) Default values when tags in the DD (WEB-INF/web.xml) are not set

In a Web container, if the following tags are not set in the DD (WEB-INF/web.xml), use the following default values.

Table 2-4 Default values when tags in the DD (WEB-INF/web.xml) are not set

Tag names Default values when tags are not set
welcome-file-list
<welcome-file-list>
 <welcome-file>
 index.jsp
 </welcome-file>
 <welcome-file>
 index.html
 </welcome-file>
 <welcome-file>
 index.htm
 </welcome-file>
</welcome-file-list>
session-timeout 30
mime-mapping Relationship between extensions and MIME types

When the tags in above table are set in the DD (WEB-INF/web.xml) , the settings will be as follows:

For details on the relationship between the extensions and the MIME types set by default in the mime-mapping tag of DD (WEB-INF/web.xml), see Appendix B.1 Correspondence Between Extensions and MIME Types in the uCosminexus Application Server Definition Reference Guide.

(3) Number of instances created for a servlet

Create one servlet instance of the same class in each Web application. Also, create one servlet instance that inherits SingleThreadModel in each Web application in the same way as a general servlet.

However, if the same servlet and JSP are accessed by both default mapping and the mapping described in the DD, the instances are generated in the following manner.

Table 2-5 Generation of instances when the same servlet and JSP are accessed by both default mapping and the mapping described in the DD

URL Instance
*.jsp Generated instance is different from the one that was generated when the same servlet and JSP are accessed by the mapping described in DD.
*.jspx
/servlet/*
  • When the fully qualified class name of the servlet is specified:
    Generated instance is different from the one that was generated when the same servlet and JSP are accessed by the mapping described in DD.
  • When the servlet name defined in web.xml is specified:
    Generated instance is same as the one that was generated when the same servlet and JSP are accessed by the mapping described in DD.

Also, when multiple requests for a single servlet that inherits SingleThreadModel arrive concurrently in each Web application, control each thread so that the threads are executed one-by-one without overlapping.

(4) Timing to execute the init method and service method of servlets

The timing to execute the init method and service method of servlets differs according to the default mapping and the servlet mapping.

(5) Servlet buffer used for sending a response

In the servlet buffer used for sending a response, only the number of request processing threads is maintained. When you use the setBufferSize method of javax.servlet.ServletResponse to change the buffer size, estimate the memory usage after considering that the memory of buffer size [Figure] number of request processing threads is secured.

(6) Parsing the query character string

The query string includes a combination of one or more Name=Value after ? mark of URL.

With Application Server, if several = exist in the Name=Value part, the character string before the first = becomes the name and the character string after = becomes the value. For example, if the URL is http://host/examples?a=b=c, the string is analyzed as 'Value of name a is b=c'.