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

Johannes Hammoud Unicode Escaping 08.11.2008

I Coding : Community about Java programing

Language German+-

Java JSF JavaScript HTML CSS NetBeans GlassFish MySQL

Imprint

Visits
6279882
Today
7204