I'm using Clay with HTML templates in an application on which I am working.  In 
several cases, I refer to managed bean properties directly in my template text 
(e.g., <p>#{mybean.prop}</p>).  I recently noticed MyFaces' ReducedHTMLParser 
throwing exceptions about malformed HTML.  Not finding any problems in my HTML 
template itself, I looked at the generated page source and discovered that in 
cases where a managed bean property contained special characters (in my case, 
less-than and greater-than signs), Clay is apparently not escaping them before 
rendering them.

Is this a bug in Clay or a "feature" (or a configuration problem on my part)?

Is there any workaround aside from putting calls to 
org.apache.commons.lang.StringEscapeUtils.escapeHtml() in every managed bean 
"getter" method that returns a String or wrapping all references in <f:verbatim 
escape="true">?

I'm using Shale v1.0.4.


Rich Eggert
Member of Technical Staff
Proteus Technologies, LLC
http://www.proteus-technologies.com

Reply via email to