shale-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Richard Eggert" <regg...@proteus-technologies.com>
Subject RE: Clay not escaping strings?
Date Thu, 09 Aug 2007 15:25:16 GMT
Just a follow-up:

Wrapping it in <span jsfid="f:verbatim" escape="true"> doesn't seem to work.  Instead,
I have to use <span jsfid="h:outputText" value="#{mybean.prop}" allowBody="false">#{mybean.prop}</span>
(I keep the body for mockup purposes).


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



-----Original Message-----
From: Richard Eggert [mailto:reggert@proteus-technologies.com]
Sent: Thu 8/9/2007 10:31 AM
To: user@shale.apache.org
Subject: Clay not escaping strings?
 
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



Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message