|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--oracle.jsp.util.PublicUtil
This class is a collection of static utility API methods, which are intended for public external usage
Constructor Summary |
PublicUtil()
|
Method Summary |
Type | Method |
---|---|
static void |
setReqCharacterEncoding(javax.servlet.http.HttpServletRequest req,
java.lang.String encoding)
The emulation of "request.setCharacterEncoding(String encoding)" when using OracleJSP on Apache/JServ. |
static void |
setWriterEncoding(javax.servlet.jsp.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 |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public PublicUtil()
Method Detail |
public static void setReqCharacterEncoding(javax.servlet.http.HttpServletRequest req, java.lang.String encoding) throws java.io.UnsupportedEncodingException
This API is intended to be used on OracleJSP on Apache/JServ only. When OC4J is used as the servlet engine, please make use of "request.setCharacterEncoding(String encoding)" directly, because OC4J is a servlet 2.3 compatible implementation.
public static void setWriterEncoding(javax.servlet.jsp.JspWriter out, java.lang.String encoding)
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.
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" %>
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.
<% oracle.jsp.util.PublicUtil.setWriterEncoding(out,"MS950"); %>
NOTE: make this call as early as possible in the page.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |