ibm-information-center/dist/eclipse/plugins/i5OS.ic.rzatz_5.4.0.1/51/program/servauto.htm

39 lines
2.6 KiB
HTML
Raw Normal View History

2024-04-02 14:02:31 +00:00
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=utf-8">
<LINK rel="stylesheet" type="text/css" href="../../../rzahg/ic.css">
<title>Automatic request and response encoding</title>
</head>
<BODY>
<!-- Java sync-link -->
<SCRIPT LANGUAGE="Javascript" SRC="../../../rzahg/synch.js" TYPE="text/javascript"></SCRIPT>
<h4><a name="servauto"></a>Automatic request and response encoding</h4>
<p>Two WebSphere Application Server - Express extensions are available, autoRequestEncoding and autoResponseEncoding.</p>
<p>In WebSphere Application Server - Express, the Web container no longer automatically sets request and response encodings, and response content types. Programmers are expected to set these values using available methods in the Servlet 2.3 Specification. If programmers choose not to use the character encoding methods, they can specify the autoRequestEncoding and autoResponseEncoding extensions, which enable the application server to set the encoding values and content type.</p>
<p>The Web container tries to determine the correct character encoding for the request parameters and data as follows:</p>
<ol>
<li>It attempts to use the client.encoding.override system property, if one is set.</li>
<li>It looks at the character set (charset) in the Content-Type header.</li>
<li>If the autoRequestEncoding value is set to true, it extracts the &quot;Accept-Language&quot; header value. If found, this value is used in conjuction with the properties/encoding.properties and properties/converter.properties files to derive the character encoding.</li>
<li>It attempts to use the default.client.encoding system property, if one is set.</li>
<li>It uses the ISO-8859-1 character encoding as the default.</li>
</ol>
<p>The Web container derives the character encoding used for the response as follows:</p>
<ol>
<li>The servlet code uses the setCharacterEncoding(String encoding) method. </li>
<li>If the autoResponseEncoding value is set to true, it extracts the &quot;Accept-Language&quot; header value. If found, this value is used in conjuction with the properties/encoding.properties and properties/converter.properties files to derive the character encoding.</li>
<li>It uses the ISO-8859-1 character encoding as the default.</li>
</ol>
<p>Use the WebSphere Development Studio for iSeries tools to change the default values for the autoRequestEncoding and autoResponseEncoding extensions. For more information, see the WebSphere Development Studio for iSeries Help.</p>
</body>
</html>