uCosminexus Application Server, Web Container Functionality Guide

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

2.6.1 Units for setting the default character encoding

With Application Server, you can specify settings for request decoding, response encoding, and default character encoding used in JSP files of each J2EE server and Web application.

This subsection describes the default character encoding settings. You can also apply the default character encoding during the execution of JSP pre-compile. For details on the default character encoding settings during the JSP pre-compilation, see 2.6.3 Application of character encoding during JSP pre-compilation.

Organization of this subsection
(1) Settings for each J2EE server
(2) Settings for each Web application
(3) Operations when character encoding is specified with multiple ranges

(1) Settings for each J2EE server

You set up default character encoding for each J2EE server. If you specify settings for default character encoding for each J2EE server, the specified character encoding will be applied to the servlets and JSP files of all the J2EE applications deployed on the J2EE server. This enables you to unify the character encoding for J2EE servers.

In the case of the J2EE servers, the default character encoding will be set up when you customize the J2EE server operation settings. For details on the settings, see 2.6.7 Execution environment settings.

(2) Settings for each Web application

You set up the default character encoding for each WAR file. When you specify settings for default character encoding for each WAR file, the specified character encoding will be applied to the servlets and JSP files included in the WAR file. This enables you to unify the character encoding for Web applications.

In the case of the Web application settings, the default character encoding will be set up when you define the J2EE application properties. For details on the settings, see 2.6.7 Execution environment settings.

(3) Operations when character encoding is specified with multiple ranges

Apart from the character encoding settings for each J2EE server or Web application, you can also set up the character encoding defined in the Servlet specifications. For the character encoding settings in the Servlet specifications, the settings are specified for each servlet or JSP file.

The following figure shows the scope of settings:

Figure 2-10 Scope of character encoding settings

[Figure]

You can also specify the default character encoding with multiple ranges. For multiple setting, the default character encoding is applied in the following sequence:

  1. Settings in each servlet or JSP file (Servlet specifications)
  2. Settings in each Web application
  3. Settings for each J2EE server

For example, as shown in Figure 2-10, the character encoding is set up in servlet 2 and J2EE server. In this case, the default character encoding set in each J2EE server is applied to all the applications in the J2EE server, but the character encoding set up in the servlet is applied only to the servlet 2.

The following table lists the valid settings for each combination of the character encoding settings:

Table 2-18 Combinations of character encoding settings and valid settings

Combination of settings Valid settings
Settings in the servlets or JSP files (Servlet specifications)# Settings in each Web application Settings for each J2EE server
Y -- -- Settings in servlets or JSP files
Y Y --
Y -- Y
Y Y Y
-- Y -- Settings in each Web application
-- Y Y
-- -- Y Settings for each J2EE server
-- -- -- Character encoding defined in the Servlet specifications

Legend:
Y: Available
--: Unavailable

Note:
If the character encoding is not specified, the character encoding defined in the Servlet specifications is applied. For details, see 2.6.5(2) Character encoding defined in the Servlet specifications.

#
In the JSP file or tag file with the XML syntax, if the encoding attribute is not specified in the XML declaration, the default encoding setup functionality is enabled.