Howto use comments in JSF pages

Hi all,

I play a little bit with JSF, at the moment. I wonder that I cannot find any information about how to comment out a part of a JSF page, that it is not rendered.

If I use the html comment tags <!-- -->

then this part is already rendered if I access the page.

If I want to comment out an invalid part, the execution will fails :(.

So is there a comment tag in JSF, which is not be rendered if a page is access?

Thank in advance

Marco

[495 byte] By [hubaera] at [2007-11-26 18:53:39]
# 1
You can use JSP comments in JSF.<%-- blah --%>
BalusCa at 2007-7-9 6:27:40 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
Thank you BalusC.Ok this works with so far. But how could I do thist if I have an xhtml page and no jsp page.ThanksMarco
hubaera at 2007-7-9 6:27:40 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
JSP comments are invisible in the XHTML output.
BalusCa at 2007-7-9 6:27:40 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4

Ok. But it seems that this doesn't work, if you page are in xhtml.

I have a page like the following one

<f:view xmlns="http://www.w3.org/1999/xhtml"

xmlns:f="http://java.sun.com/jsf/core"

xmlns:h="http://java.sun.com/jsf/html" >

<div>

<h:outputText value="Some output" />

</div>

</f:view>

If I use

<%-- some comment --%>

somewhere in the page I get a Exception with the message "The content of elements must consist of well-formed character data or markup."

Regards

Marco

hubaera at 2007-7-9 6:27:40 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...