Unicode Escaping

Problem

In the past Mojarra converts any non-ascii character to html entities even if the application uses UTF-8. This had two negative effects:

Solution

The latest Mojarra version contains now an really good enhancement. Developers can control escaping in the web.xml just by setting the new context parameter com.sun.faces.disableUnicodeEscaping to one of the following values:

false
always escape, no matter of response encoding (default)
true
never escape, response encoding can handle all characters
auto
escape on ISO-8859-1, no escape on UTF encoding
<context-param> <param-name>com.sun.faces.disableUnicodeEscaping</param-name> <param-value>true</param-value> </context-param>

Modern browser support unicode, so in an UTF-8 application you should use true. Except if you are targeting also mobile phones, in that case auto is preferable.

Resources

[1] Mojarra 1.2_09

Author: Johannes HammoudComments Date: 08.11.2008

Language German

Java JSF XHTML WML JavaScript GlassFish MySQL NetBeans

Imprint

Visits
582379
Today
35