Book Image

Mastering JavaServer Faces 2.2

By : Anghel Leonard
Book Image

Mastering JavaServer Faces 2.2

By: Anghel Leonard

Overview of this book

Table of Contents (20 chapters)
Mastering JavaServer Faces 2.2
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
The JSF Life Cycle
Index

Creating a simple template – PageLayout


When these eleven tags combine their skills, we can create amazing templates. For example, let's suppose that we want to create the template from the following diagram and we name it PageLayout:

Note

Notice that with just a few clicks, NetBeans can generate the code behind several templates of Facelets, including the preceding abstractization. But, this time we will write it manually, in order to exemplify the Facelets tags. While NetBeans provides a compact code, based on a single XHTML page, we will write an expanded approach using six XHTML pages. In this way, you will have two ways of writing this kind of template.

As you can see, there are five distinctive sections: Header, Footer, Left, Center, and Right. For each of these sections, we will write a separate XHTML page. The header is generated in the topDefault.xhtml page, that simply uses the <ui:composition> tag to provide the default content as follows:

<?xml version='1.0' encoding='UTF...