Having jumped in at the deepend with JSF2 recently I noticed that adding comments to my facelets pages using the standard HTML commenting syntax:
<!-- comment here -->
actually results in the comment being sent as part of the output stream to the browser.
This is very annoying because I’ve generally put the comments in the xhtml for maintenance purposes so I don’t want anyone who views the source to see them; also they can actually be interpreted by JSF component libraries and add rendered output which you didn’t expect (such as extra rows in auto generated tables).
Thankfully JSF2 has a handy setting to stop comments being sent in the output stream. In your project web.xml file simply add the following to your web-app section:
Comments should no longer make it to the output stream.