Netscape ENTERPRISE SERVER 6.0 - PROGRAMMER GUIDE TO SERVLETS Programmer's Manual page 76

Guide to servlets
Table of Contents

Advertisement

Clarifications for Using Methods
Clarification
When your form fields contain non-UTF-8 characters, you must do one of the
following, or the values extracted by the
undefined:
Set the
in the
page 22.
Set the
the
information, see "parameterEncoding," on page 95.
Because the original encoding used to enter data into form fields is lost when the
data is URL-encoded, you must do the following:
Always set the response content type when sending a form to a client. This
ensures that the entire form gets safely to the client.
When sending form data to a server that uses a different locale than the form
fields, you must tell the server the
method, as follows:
76
Netscape Enterprise Server Programmer's Guide to Servlets • November 2001
attribute of the
enc
file. For more information, see "parameter-encoding," on
web-apps.xml
parameterEncoding
contexts.properties
If the servlet or JSP that generated the form is different than the one
processing the form, use a hidden field in the form (called
default), for example:
<input type="hidden" name="j_encoding" value="US_ASCII">
Set the
com.netscape.server.http.servlet.parameterEncoding
attribute in the request object (see "ServletRequest.setAttribute," on
page 75). The
getParameter
parameters.
If
parameterEncoding=responseCT
same servlet or JSP generates and processes the form, you can set the
response content type. For servlets, explicitly set it as in this example:
res.setContentType("text/plain; charset=Shift_JIS");
For JSPs, set the response content type using a page directive, for example:
<%@ page contentType="text/html; charset=gb2312"%>
getParameter
parameter-encoding
property to
(the default) or
auto
file, as in iPlanet Web Server 4.x. For more
before you call the
charset
method uses this attribute to decode the
in
contexts.properties
method are zeros or are
element to
(the default)
auto
responseCT
getParameter
j_encoding
and the
in
by

Advertisement

Table of Contents
loading

This manual is also suitable for:

Enterprise server 6.0

Table of Contents