You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by Koci Martin <ma...@aura.cz> on 2005/05/03 14:19:15 UTC

How to not escaping with ResponseWriter

Hi,

I have custom renderer for rendering messages in JavaScript element:
...
    writer.startElement(HTML.SCRIPT_ELEM, component);
    writer.writeAttribute(HTML.SCRIPT_LANGUAGE_ATTR, 
HTML.SCRIPT_LANGUAGE_JAVASCRIPT, null);
    writer.writer("alert( ....
...
    writer.write(curMessage.getDetail());  
...
    writer.endElement(HTML.SCRIPT_ELEM);

But writer is always  instance of 
org.apache.myfaces.renderkit.html.HtmlResponseWriterImpl and all write* 
methods contain escaping with HTMLEncoder or UnicodeEncoder and rendered 
javascript then contains &#2598 ... Unfortunately "alert" shows &#2598 
instead of normal character.

I think MYFACES-218 is the same issue. Is there any fast solution or 
workaround?

Thanks,

Martin