Using AddThis fb:like And g:plusone Attributes With Facelets |
Facelets won't parse code like this because of the semicolons:
<a class="addthis_button_google_plusone" g:plusone:size="medium"></a>
The following exception is raised.
javax.faces.view.facelets.FaceletException: Error Parsing /apps/cms/tags/share.xhtml: Error Traced[line: 15] Attribute name "g:plusone" associated with an element type "a" must be followed by the ' = ' character.
CDATA escaping and f:verbatim doesn't fix the problem. The only way around this I could find is using h:output text without escaping the output.
<!-- escaped because facelets won't parse the g:plusone:size attribute --> <h:outputText escape="false" value=" <a class="addthis_button_google_plusone" g:plusone:size="medium"></a>"/>
Notice the input needs to be escaped because facelet files are XML. Ugly. Something like Tomahawk's t:htmlTag would do a better job, but it doesn't support adding arbitrary attributes.
Using AddThis fb:like And g:plusone Attributes With FaceletsRoger Keays is an artist, an engineer, and a student of life. He has no fixed address and has left footprints on 40-something different countries around the world. Roger is addicted to surfing. His other interests are music, psychology, languages, the proper use of semicolons, and finding good food. |