Java Reference
In-Depth Information
to be used along with the template. The template file must be named template.xhtml . For instance, to generate a
template named “mocha” for an application, one could construct a hierarchy such as in Figure 2-2 .
Figure 2-2. Resource Library Contracts Hierarchy
If only one template directory resides within an application's /contracts or /META-INF/contracts directory,
then that template can be applied to any view within the application by simply referencing the template as
/template.xhtml within the template annotation of a view. For example, the contents of the template.xhtml file
residing within the mocha directory are as follows:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
" " >
<html xmlns=" "
xmlns:ui=" "
xmlns:h=" " >
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<h:outputStylesheet name="layout.css"/>
<title>Introduction to Java EE 7 - Mocha Style</title>
<div id="top">
<h2>Intro to Java EE 7</h2>
<div id="left">
<h:form id="navForm">
<h:outputLink value="/IntroToJavaEE7/faces/chapter01/index.xhtml" >
Chapter 1</h:outputLink>
<h:outputLink value="/IntroToJavaEE7/faces/chapter02/index.xhtml">
Chapter 2</h:outputLink>
<h:outputLink value="/IntroToJavaEE7/faces/chapter03/index.xhtml">
Chapter 3</h:outputLink>
<h:outputLink value="/IntroToJavaEE7/faces/chapter04/index.xhtml">
Chapter 4</h:outputLink>
Search WWH ::

Custom Search