Java Reference
In-Depth Information
<link href="./resources/css/default.css" rel="stylesheet"
type="text/css" />
<link href="./resources/css/cssLayout.css" rel="stylesheet"
type="text/css" />
<title>Facelets Template</title>
</h:head>
<h:body>
<div id="top" class="top">
<ui:insert name="top">Top</ui:insert>
</div>
<div>
<div id="left">
<ui:insert name="left">Left</ui:insert>
</div>
<div id="content" class="left_content">
<ui:insert name="content">Content</ui:insert>
</div>
</div>
</h:body>
</html>
As we can see, the template doesn't look much different from a regular Facelets file.
Adding a Facelets template to our project
We can add a Facelets template to our project simply by clicking on
File | New File
,
then selecting the
JavaServer Faces
category and the
Facelets Template
file type.
Notice that the template uses the following namespace:
xmlns:ui="http://java.
sun.com/jsf/facelets"
. This namespace allows us to use the
<ui:insert>
tag, the
contents of this tag will be replaced by the content in a corresponding
<ui:define>
tag in template clients.