Skip navigation links

Oracle Containers for J2EE Support for JavaServer Pages Java API Reference
10g (10.1.3.1.0)

B28960-01


oracle.jsp.util
Class PublicUtil

java.lang.Object
  extended byoracle.jsp.util.PublicUtil


public class PublicUtil
extends java.lang.Object

This class is a collection of static utility API methods, which are intended for public external usage


Constructor Summary
PublicUtil()
           

 

Method Summary
static void setWriterEncoding(JspWriter out, java.lang.String encoding)
          to set special char set (non-IANA charset, for example, "MS950") in JspWriter.

 

Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

PublicUtil

public PublicUtil()

Method Detail

setWriterEncoding

public static void setWriterEncoding(JspWriter out,
                                     java.lang.String encoding)
to set special char set (non-IANA charset, for example, "MS950") in JspWriter. <p/> Background information:
Normally, JSP developers would set the character set of the JspWriter through:
(i) a page directive: e.g. <%@ page contentType="text/html;charset=xyz" %>
or (ii) response object API: e.g. response.setContentType("text/html;charset=xyz");
That means, the charset of the content type is the charset used in JspWriter. However, there are some some NLS character sets which are not IANA charset. That means, we cannot use those charset in content type directly. Because, most of browsers would just recognize non-IANA charset as their content type. <p/> Hence, we have developed this special API to decouple the charset in contentType and the charset used in JspWriter. After using this API, the charset from the content type will be overrided by the charset given in this API parameter. e.g.:
<%@ page contentType="text/html;charset=Big-5" %>
<% oracle.jsp.util.PublicUtil.setWriterEncoding(out,"MS950"); %>
This example uses "Big-5" as the charset of the content type, while using "MS950" (a non-IANA HongKong dialect version of "Big-5" charset) as the charset of JspWriter. <p/> NOTE: make this call as early as possible in the page.

Skip navigation links

Oracle Containers for J2EE Support for JavaServer Pages Java API Reference
10g (10.1.3.1.0)

B28960-01


Copyright © 2004, 2006, Oracle. All rights reserved.