Learn Java for Web Development

(Tina Meador) #1
CHAPTER 6: Component-Based Web Development Using JSF 2 283

Listing 6-7. ui:composition Tag



The optional attribute declares a template to which the enclosed content should be applied using
the template attribute.


ui:decorate

The difference between the ui:decorate tag and the ui:composition tag is that, unlike
ui:composition, ui:decorate causes surrounding content to be included in the page as well. Listing
6-8 illustrates the syntax of ui:decorate.


Listing 6-8. ui:decorate Tag



ui:define

The ui:define tag is used inside a ui:composition tag in template client files to define a region
that will be inserted into the composition at the point provided by the ui:insert tag. Listing 6-9
illustrates the syntax of ui:define.


Listing 6-9. ui:define Tag



ui:insert

The ui:insert tag is used in the template files to indicate where the ui:define in the template client
should be inserted. Listing 6-10 illustrates the syntax of ui:insert.


Listing 6-10. ui:insert Tag



If no name is specified, the content in the body of the ui:insert tag is added to the view.


ui:include

The ui:include can be used in the template files or template client files. Listing 6-11 illustrates the
syntax of ui:include.


Listing 6-11. ui:include Tag


Free download pdf