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.  Java Servlet Technology

JavaServer Faces Technology User Interface

JavaServer Faces Technology Benefits

What Is a JavaServer Faces Application?

User Interface Component Model

User Interface Component Classes

Component Rendering Model

Conversion Model

Event and Listener Model

Validation Model

Navigation Model

Backing Beans

Creating a Backing Bean Class

Configuring a Bean

Using the Unified EL to Reference Backing Beans

The Life Cycle of a JavaServer Faces Page

Restore View Phase

Apply Request Values Phase

Process Validations Phase

Update Model Values Phase

Invoke Application Phase

Render Response Phase

Further Information about JavaServer Faces Technology

6.  Introduction to Facelets

7.  Using JavaServer Faces Technology in Web Pages

8.  Developing with JavaServer Faces Technology

9.  Configuring JavaServer Faces Applications

Part III Web Services

10.  Introduction to Web Services

11.  Building Web Services with JAX-WS

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

Part IV Enterprise Beans

13.  Enterprise Beans

14.  Getting Started with Enterprise Beans

15.  Running the Enterprise Bean Examples

Part V Persistence

16.  Introduction to the Java Persistence API

17.  Running the Persistence Examples

18.  The Java Persistence Query Language

Part VI Security

19.  Introduction to Security in the Java EE Platform

20.  Using Java EE Security

21.  Securing Java EE Applications

22.  Securing Web Applications

Part VII Java EE Supporting Technologies

23.  Introduction to Java EE Supporting Technologies

24.  Transactions

25.  Resource Connections

Index

 

Chapter 5

JavaServer Faces Technology

JavaServer Faces technology is a server-side user interface component framework for building Java technology-based web applications.

The main components of JavaServer Faces technology are as follows:

  • An API for representing UI components and managing their state; handling events, server-side validation, and data conversion; defining page navigation; supporting internationalization and accessibility; and providing extensibility for all these features

  • Various tag libraries for expressing UI components within web pages and for wiring components to server-side objects

JavaServer Faces technology provides a well-defined programming model and various tag libraries. These features significantly ease the burden of building and maintaining web applications with server-side UIs. With minimal effort, you can:

  • Construct a UI with reusable and extensible components

  • Drop components onto a page by adding component tags

  • Wire component-generated events to server-side application code

  • Bind UI components on a page to server-side data

  • Save and restore UI state beyond the life of server requests

JavaServer Faces 2.0, included in Java EE 6, is a major revision of the specification and introduces several new features that greatly enhance the process of development and deployment of JavaServer Faces based web applications.

The following are some of the new features that are supported by JavaServer Faces 2.0:

  • Facelets as presentation technology for JavaServer Faces

  • Templating and Composite Components through Facelets

  • New HTML tags for easier page creation

  • Bookmarkability with new tags: h:button and h:link

  • New components and event types for additional functionality

  • Resource registration using Annotations

  • Resource relocation through Annotations

  • Implicit Navigation Rules

  • Support for Bean Validation based on JSR 303

  • Project Stage to describe the status of the application in the project life cycle

  • Support for Ajax with f:ajax tag and the JavaServer Faces JavaScript Library (jsf:ajax)

Some of the above new features are covered in more detail in the next chapters of this tutorial. The features that are considered advanced topics, are covered in Java EE 6 Tutorial, Volume II: Advanced Topics.