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

Rendering a UI composition

In the previous example, we saw that content from one page could be included in another page by using a combination of the<ui:include> and<ui:composition> tags. Let's discuss the<ui:composition> tag in more detail.

When Facelets encounters a<ui:composition> tag, it includes the surrounded content and "trims" the content outside this tag. The surrounded content is included as is, and unlike the<ui:component> tag, is not wrapped in a UI component.

Including a UI composition

The following source code example demonstrates how to include a Facelets UI composition using the<ui:include> tag. When the markup in the file named composition.jsf is included, only the content inside the<ui:composition> tag is rendered.

<!DOCTYPE html ...

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