Removing the content with <ui:remove>

The <ui:remove> tag is used for removing the content. This tag is rarely used, but a perfect example of this is removing comments of type <!-- -->. You probably thought of something like the following line:

<!-- <h:outputText value="I am a comment!"/> -->

It doesn't have any side effects on the HTML rendered code. Well, that isn't true, because in the HTML source code, you will see something similar to the following screenshot:

Removing the content with <ui:remove>

But if we encapsulate this in <ui:remove>, then the preceding client side effect will not be produced anymore, which has the following code.

<ui:remove> <!-- <h:outputText value="I am a comment!"/> ...

Get Mastering JavaServer Faces 2.2 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.