O'Reilly logo

JSF 1.2 Components by Ian Hlavats

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Removing UI components and markup

Sometimes, it is desirable to remove certain elements from a JSF page during development without necessarily deleting the markup. As developers we are accustomed to "commenting out" code, but standard JSF does not provide a simple way for us to remove markup without deleting it.

We can always set the rendered attribute to false for UI components, but what if the rendered attribute is already specified based on some EL expression? We can use HTML comments, but any EL expressions in those comments will still be evaluated, possibly resulting in runtime errors.

Facelets provides a simple solution to this problem: the<ui:remove> tag. Any markup wrapped by the<ui:remove> tag will literally be removed from the UI component ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required