You can find more information at Oracle documentation:
We need to use tag <ui:remove>
and </ui:remove>
between any JSF code that we want to comment it.
<ui:remove>
<h:outputLabel value="Yeah, I'm really commented" />
</ui:remove>
Of course you need add this xmlns to your header html tag. Check this minimal full example:
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets">
<ui:remove>
<h:outputLabel value="Yeah, I'm really commented" />
</ui:remove>
</html>
You must to add to web.xml a configuration tag like this:
<context-param>
<param-name>facelets.SKIP_COMMENTS</param-name>
<param-value>true</param-value>
</context-param>
Now you can use normal HTML comments tag <!--
and -->
<!--
<h:outputLabel value="Yeah, I'm really commented" />
-->
Previuosly full example with facelets.SKIP_COMMENTS configured in web.xml will be:
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets">
<!--
<h:outputLabel value="Yeah, I'm really commented" />
-->
</html>