Invisible comments in jsf 2.0?

Tim picture Tim · Aug 17, 2010 · Viewed 15.1k times · Source

is it possible to embed comments in my .xhtml-files that are only displayed in the source and not the rendered result? I want to include author, date,... in the files but they should not be visible to the enduser in the generated output. If I use the standard comment-tags <!-- --> the browser displays them.

Answer

Petar Minchev picture Petar Minchev · Aug 17, 2010

Add the following into your web.xml:

<context-param>
    <param-name>javax.faces.FACELETS_SKIP_COMMENTS</param-name>
    <param-value>true</param-value>
</context-param>

This way Facelets will skip the comments while parsing the view xhtml template.