<div class="gmail_quote">On Tue, May 12, 2009 at 4:36 PM, Dan Allen <span dir="ltr">&lt;<a href="mailto:dan.j.allen@gmail.com">dan.j.allen@gmailcom</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="gmail_quote"><div class="im">On Tue, May 12, 2009 at 3:47 PM, Martin Marinschek <span dir="ltr">&lt;<a href="mailto:mmarinschek@apache.org" target="_blank">mmarinschek@apache.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

Hi Andy,<br>
<br>
one more issue which _always_ comes up with people working with<br>
facelets and of course also stems from the same root-cause is the<br>
comment-problem - how can you correctly have comments for facelets and<br>
comments for the output?<br>
<br>
The way we currently do this is either set SKIP_COMMENTS to true -<br>
which effectively disallows HTML comments - or use ui:remove to make<br>
parts of the page Facelets-comments. However, the second approach<br>
doesn&#39;t allow invalid XML-snippets inside the ui:remove section - and<br>
this can be a very annoying thing then.<br>
<br>
Maybe it would be better to set SKIP_COMMENTS to true by default - and<br>
then have an &lt;h:outputComment&gt; for emitting HTML comments (I believe<br>
the problem of invalid XML in HTML-comments is not as big as in<br>
comments which are meant to be there for facelets).</blockquote></div><div><br>Martin, you have struck a very strong chord with me. I was just dealing with this exact issue all week. To create a real Facelets comment, putting SKIP_COMMENTS aside, I have to do:<br>

<br>&lt;ui:remove&gt;&lt;!--<br>I&#39;m thinking of using &lt;rich:dataTable&gt; but I haven&#39;t added the RichFaces libraries yet.<br>--&gt;&lt;/ui:remove&gt;<br><br>To me, that seems like complete overkill. I would much prefer if Facelets just stayed out of comments and like Martin said, we consider producing a comment with a tag (since producing a comment is extremely rare anyway). I would even support the idea of using comment markers inside the tag so that it is still possible to use invalid XML.<br>

<br>&lt;h:outputComment&gt;&lt;!--<br>This is a comment with invalid &lt;&lt;XML&gt;&gt;<br>--&gt;&lt;/h:outputComment&gt;<br> <br>Of course, the comment markers would be optional...they just allow the template to be well-formed XML if you happen to use invalid markup in the comment.</div>
</div></blockquote><div><br>I should also mention that Facelets interpolates EL in comments (when they are not skipped) which almost always surprises developers. I would guess that with &lt;h:outputComment&gt; the EL would be interpolated since the intent is to render the content. That would be consistent. You almost never want Faclets to interpolate EL in a developer comment (not rendered)<br>
<br>-Dan </div></div><br>-- <br>Dan Allen<br>Senior Software Engineer, Red Hat | Author of Seam in Action<br><br><a href="http://mojavelinux.com">http://mojavelinux.com</a><br><a href="http://mojavelinux.com/seaminaction">http://mojavelinux.com/seaminaction</a><br>
<a href="http://in.relation.to/Bloggers/Dan">http://in.relation.to/Bloggers/Dan</a><br><br>NOTE: While I make a strong effort to keep up with my email on a daily<br>basis, personal or other work matters can sometimes keep me away<br>
from my email. If you contact me, but don&#39;t hear back for more than a week,<br>it is very likely that I am excessively backlogged or the message was<br>caught in the spam filters.  Please don&#39;t hesitate to resend a message if<br>
you feel that it did not reach my attention.<br>