Document Information

Preface

Part I Introduction

1.  Overview

2.  Using the Tutorial Examples

Part II The Web Tier

3.  Getting Started with Web Applications

4.  JavaServerTM Faces Technology

5.  Introduction to Facelets

Advantages of Facelets

Developing a Simple Facelets Application

Creating a Facelets Application

Developing a Backing Bean

Creating Facelets Views

Configuring the Application

Building, Packaging, Deploying and Running the Application

To Create the Example Facelets Application with NetBeans IDE

To Create the Application

Templating

Composite Components

Resources

6.  Unified Expression Language

7.  Using JavaServerTM Faces Technology in Web Pages

8.  Using Converters, Listeners and Validators

9.  Developing With JavaServerTM Faces Technology

10.  Java Servlet Technology

Part III Web Services

11.  Introduction to Web Services

12.  Building Web Services with JAX-WS

13.  Building RESTful Web Services with JAX-RS and Jersey

Part IV Enterprise Beans

14.  Enterprise Beans

15.  Getting Started with Enterprise Beans

16.  Running the Enterprise Bean Examples

Part V Contexts and Dependency Injection for the JavaTM EE Platform

17.  Introduction to Contexts and Dependency Injection for the JavaTM EE Platform

18.  Running the Basic Contexts and Dependency Injection Examples

Part VI Persistence

19.  Introduction to the Java Persistence API

20.  Running the Persistence Examples

21.  The Java Persistence Query Language

22.  Creating Queries Using the Criteria API

Part VII Security

23.  Introduction to Security in the Java EE Platform

24.  Getting Started Securing Enterprise Applications

25.  Getting Started Securing Web Applications

Part VIII JavaTM EE Supporting Technologies

26.  Introduction to JavaTM EE Supporting Technologies

27.  Transactions

28.  Resource Connections

Index

 

What's Facelets ?

Facelets is a powerful but lightweight page declaration language that is used to build JavaServer Faces views using HTML style templates and to build component trees.

Facelets features include the following:

  • Use of XHTML for creating web pages

  • Support for Facelets Tag libraries in addition to JavaServer Faces and JSTL tag libraries

  • Support for unified expression language

  • Templating for components and pages

Web Pages

Facelets views are usually created as XHTML pages. JavaServer Faces implementations support XHTML pages created in conformance with the XHTML Transitional DTD, as listed at http://www.w3.org/TR/xhtml1/#a_dtd_XHTML-1.0-Transitional.

By convention, web pages built with XHTML have an .xhtml extension.

Tag Library Support

JavaServer Faces technology supports different tag libraries to add components to a web page. To support the JavaServer Faces tag library mechanism, Facelets uses XML namespace declarations.

The following table Table 5-1 lists the tag libraries supported by Facelets.

Table 5-1 Tag Libraries Supported by Facelets

Tag Library

URI

Prefix

Example

Contents

JavaServer Faces Facelets Tag Library

http://java.sun.com/jsf/facelets

ui:

ui:component

ui:insert

Tags for templating

JavaServer Faces HTML Tag Library

http://java.sun.com/jsf/html

h:

h:head

h:body

h:outputText

h:inputText

JavaServer Faces component tags for all UIComponents.

JavaServer Faces Core Tag Library

http://java.sun.com/jsf/core

f:

f:actionListener

f:attribute

Tags for JavaServer Faces custom actions that are independent of any particular RenderKit.

JSTL Core Tag Library

http://java.sun.com/jsp/jstl/core

c:

c:forEach

c:catch

JSTL 1.1 Core Tags

JSTL Functions Tag Library

http://java.sun.com/jsp/jstl/functions

fn:

fn:toUpperCase

fn:toLowerCase

JSTL 1.1 Functions Tags

In addition, Facelets also supports tags for composite components for which you can declare custom prefixes. For more information on composite components, see Composite Components.

Unified Expression Language Support

Based on the JavaServer Faces support for unified expression language (EL) syntax defined by JSP 2.1, Facelets uses EL expressions to reference properties and methods of backing beans. EL expressions can be used to bind component objects or values to managed-bean methods or managed-bean properties. For more information on using EL expressions, see Using the EL to Reference Backing Beans.