Book Image

Java EE 7 Development with NetBeans 8

By : David R Heffelfinger
5 (1)
Book Image

Java EE 7 Development with NetBeans 8

5 (1)
By: David R Heffelfinger

Overview of this book

Table of Contents (18 chapters)
Java EE 7 Development with NetBeans 8
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Facelets templating


One advantage that Facelets has over JSP is its templating mechanism. Templates allow us to specify page layout in one place. Then, we can have template clients that use the layout defined in the template. Since most web applications have consistent layout across pages, using templates makes our applications much more maintainable because changes to the layout need to be made in a single place. If at one point we need to change the layout for our pages (for example, add a footer or move a column from the left side of the page to the right side of the page), we only need to change the template and the change is reflected in all the template clients.

Adding the Facelets template

We can add a Facelets template to our project simply by going to File | New File, selecting the JavaServer Faces category, and selecting the Facelets Template file type.

NetBeans provides very good support for Facelets templating. It provides several templates "out of the box" using common web page...