Using Facets

Some component types use facets. A facet is different from a regular child component in that it has a special purpose, specified by its name, but any component type can be used as a facet. In a JSP page, a facet is represented by the <f:facet> element. The <h:column> action supports two facets: header and footer. The <h:dataTable> action renders the header facet as a column header and, as you’ve probably guessed, it renders the footer facet as a column footer. You can specify header and footer facets for the table itself using <f:facet> elements as direct children of the <h:dataTable> element. It renders the table header and footer as rows with a single column spanning the whole table before and after the real table data.

Get JavaServer Faces 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.