Learn Java for Web Development

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































































  •    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">

    Free download pdf