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

Composite components


A very nice JSF feature is the ability to easily write custom JSF components. With JSF 2, creating a custom component involves little more than creating the markup for it, without any Java code or configuration. Since custom components are typically composed of other JSF components, they are referred to as composite components.

We can generate a composite component by going to File | New File, selecting the JavaServer Faces category, and selecting the JSF Composite Component file type.

After clicking on Next, we can specify the filename, project, and folder for our custom component.

Note

To take advantage of JSF 2.0's automatic resource handling and conventions, it's not recommended to change the folder where our custom component will be placed.

When we click on Finish, NetBeans generates an empty composite component we can use as a base to create our own:

<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    ...