Part IV Presentation of Mobile Content
JSP Files and Servlets
To ensure the output of your JSP page matches the encoding of the rest of the system, insert the
following encoding statement in your JSP file:
<%@ page contentType="encoding" %>
where encoding is the encoding of your choice.
For servlets, you can specify content type and character encoding in your HTTPServletRequest
and HTTPServletResponse objects using:
•
setCharacterEncoding() in request objects and
•
setContentType() in response objects.
For example:
HttpServletResponse.setContentType("text/ html;charset=iso-8859-1");
How WebLogic Mobility Server Determines Character Encoding
While a web server may pass on the byte stream without decoding, WebLogic Mobility Server
needs to decode / encode the mark-up so it can perform the appropriate transformations and then
recode the result for transmission.
WebLogic Mobility Server uses the following sequence to determine the character encoding for a
document:
1. It determines whether Unicode is used. WebLogic Mobility Server only checks for UTF-16
Byte Order Marks so if the document is UTF-8 encoded the HTTP server must be configured
to set the Content-Type header.
5. Next, WebLogic Mobility Server checks the HTTP protocol to see if the Content-type
response header has been defined.
6. If not, WebLogic Mobility Server checks the XML declaration and if this doesn't exist, the
HTML meta tag is checked.
<META HTTP-EQUIV="Content-Type" CONTENT="text/html;
charset=ISO-8859-1">
110 - BEA WebLogic Mobility Server User Guide
Need help?
Do you have a question about the WebLogic and is the answer not in the manual?