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

Resource library contracts


Resource library contracts is a new JSF 2.2 feature. It builds on Facelets templates to allow us to build "themable" web applications. For example, we could have an application with multiple customers or we could render the application user interface so that each user sees their own company's logo after logging in. Alternatively, we could have the user select from a predefined set of themes, which is exactly what we are going to do in our next example.

We can create a resource library contract by going to File | New and selecting JSF Resource Library Contract from the JavaServer Faces category in the New File wizard.

We need to give our resource library contract a name by entering a value into the Contract Name input field. We can optionally allow NetBeans to generate the initial templates for our resource library contract.

In our example, we are going to have NetBeans generate the initial template and then we'll modify the CSS a bit so that the resulting page will...