Let's delve into some code to demonstrate the JSF composition before we close this chapter. We will start with a simple JSF template that lies out a web page in two areas: a top area and the main area.
This template-top.xhtml
file is the JSF view that performs the following:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://xmlns.jcp.org/jsf/html" xmlns:ui="http://xmlns.jcp.org/jsf/facelets"> <h:head> <title>Digital Java EE 7 - Sample JSF</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"/> <meta name="description" content="XeNoNiQUE"/> <meta name="author" content="Peter Pilgrim"/> <h:outputStylesheet library="styles" name="main.css" rel="stylesheet"/> <h:outputStylesheet...