Java Reference
In-Depth Information
8. <h:body>
9. <div id="centered">
10. <div>
11. <ui:insert name="header">
12. <ui:include src="/templates/header.xhtml" />
13. </ui:insert>
14. </div>
15. <div>
16. <ui:insert name="sideBar">
17. <ui:include src="/templates/sideBar.xhtml" />
18. </ui:insert>
19. </div>
20. <div>
21. <ui:insert name="content">
22. <ui:include src="/templates/contents.xhtml" />
23. </ui:insert>
24. </div>
25. </div>
26. </h:body>
27. </html>
Line 3 : Declares the namespace for the HTML library
Line 4 : Declares the namespace for the Facelet library
Line 5 to 7 : Show the usage of the h:head tag instead of using the markup
<head/>
Line 8 : Shows the usage of the h:body tag instead of using the markup <body/>
Lines 11 to 13 : Show the usage of the u:insert tag for templating the body
content of the <ui:insert> tag that is added to the view
Line 12 : Shows the usage of the ui:include tag for the inclusion
of header.xhtml
Line 17 : Shows the usage of the ui:include tag for the inclusion of
sideBar.xhtml
Line 22 : Shows the usage of the ui:include tag for the inclusion of
contents.xhtml
Listing 6-14 illustrates the template client header.xhtml .
Listing 6-14. header.xhtml
1. <?xml version="1.0" encoding="UTF-8"?>
2. <html xmlns=" http://www.w3.org/1999/xhtml "
3. xmlns:h=" http://java.sun.com/jsf/html "
4. xmlns:ui=" http://java.sun.com/jsf/facelets ">
 
Search WWH ::




Custom Search