Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Java EE 7 Development with NetBeans 8

You're reading from  Java EE 7 Development with NetBeans 8

Product type Book
Published in Jan 2015
Publisher Packt
ISBN-13 9781783983520
Pages 364 pages
Edition 1st Edition
Languages
Author (1):
David R Heffelfinger David R Heffelfinger
Profile icon David R Heffelfinger

Table of Contents (18) Chapters

Java EE 7 Development with NetBeans 8
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
1. Getting Started with NetBeans 2. Developing Web Applications Using JavaServer Faces 2.2 3. JSF Component Libraries 4. Interacting with Databases through the Java Persistence API 5. Implementing the Business Tier with Session Beans 6. Contexts and Dependency Injection 7. Messaging with JMS and Message-driven Beans 8. Java API for JSON Processing 9. Java API for WebSocket 10. RESTful Web Services with JAX-RS 11. SOAP Web Services with JAX-WS 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" 
    ...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}