284 CHAPTER 6: Component-Based Web Development Using JSF 2
ui:param
The ui:param tag is used inside ui:include tags to define name-value pairs for parameterized
inclusion of the pages. Listing 6-12 illustrates the syntax of ui:param.
Listing 6-12. ui:param Tag
Next you will implement templating with Facelets. Create a JSF project similar to the Hello World
project in the earlier section. In this application, you will create the header and sidebar template
that will be used in the bookstore application. Figure 6-16 illustrates the directory structure of the
application.
Figure 6-16. Directory structure of the JSFTemplate application
Listing 6-13 illustrates the template file common.xhtml.
Listing 6-13. common.xhtml
- <?xml version="1.0" encoding="UTF-8"?>
- <html xmlns="http://www.w3.org/1999/xhtml"
- xmlns:h="http://java.sun.com/jsf/html"
- xmlns:ui="http://java.sun.com/jsf/facelets">