The web-apps.xml File and Virtual Servers
Chapter 2 Web Applications 23
If a servlet uses the ServletRequest.getParameter method to retrieve values in
form fields having non-UTF-8 characters, the
enc attribute must be set to auto (the
default). Otherwise, the values extracted by the
getParameter method are zeros or
are undefined. For more information see “ServletRequest.getParameter,” on page
74.
The
enc attribute setting applies to how a servlet processes parameters after the
iPlanet Web Server receives a request. The URI that is sent to the server must
consist of only the standard ASCII set, especially if the request method is GET. All
other characters must be encoded.
For example, to encode a backslash, you would replace the backslash with a
%
followed by the hexadecimal number corresponding to the backslash in the ASCII
character set,
5c. Therefore, vw\xyz becomes vw%5cxyz.
For more information, read section 2.2 of the following document from the URI
working group of the Internet Engineering Task Force:
http://www.ietf.org/rfc/rfc1738.txt
auto (Default) Tries to figure out the proper encoding
from, in order, 1) the charset if it is set in the
Content-Type header, 2) the
parameterEncoding attribute (see
“ServletRequest.setAttribute,” on page 73),
then 3) a hidden form field defined in
form-hint-field. Otherwise, the system
default encoding is used. Set this option to prevent
misinterpretation of non-ASCII characters in
servlet parameters.
When this property is set to auto, the server has to
convert native characters into a java byte array
before transforming them into the requested
encoding. Therefore, performance is slightly better
for none or a specific encoding.
form-hint-field The name of the hidden field in the form that specifies the
encoding. The default is j_encoding.
Kommentare zu diesen Handbüchern