autoRequestEncoding and autoResponseEncoding
Starting with WAS V5, the Web container no longer automatically sets...
- request and response encodings
- response content types
Programmers are expected to set these values using available methods in Servlet 2.3 spec or later.
If programmers choose not to use the character encoding methods, they can specify the extensions...
- autoRequestEncoding = true/false
- autoResponseEncoding = true/false
...which enables the appserver to set the encoding values and content type. Default for both is false.
If the value is false for both autoRequestEncoding and autoResponseEncoding, then the request and response character encoding is set to Servlet 2.3 spec default, which is ISO-8859-1.
If the value is set to false for a response, the Web container cannot set a response content type.
Different character encodings are possible if the client defines character encoding in the request header, or if the code includes the method...
setCharacterEncoding(String encoding)If autoRequestEncoding = true, and the client did not specify character encoding in the request header, and the code does not include the method...
setCharacterEncoding(String encoding)...the Web container tries to determine the correct character encoding for the request parameters and data.
Use an assembly tool to change the default values for the autoRequestEncoding and autoResponseEncoding extensions.
The Web container performs each step in the following list until a match is found:
- Looks at charset in the Content-Type header.
- Attempts to map the servers locale to a character set.
- Attempts to use the DEFAULT_CLIENT_ENCODING system property.
- Uses the ISO-8859-1 character encoding as the default.
If autoResponsetEncoding = true, and the client did not specify character encoding in the request header, and the code does not include the method...
setCharacterEncoding(String encoding)...the Web container does the following...
- Attempts to determine the response content type and character encoding from information in the request header.
- Uses the ISO-8859-1 character encoding as the default.
Related concepts
Globalization
Related
Web apps: Links