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

JavaServer Faces Technology Benefits

Creating a Simple JavaServer Faces Application

Developing Backing Beans

Creating the Web Page

Mapping the Faces Servlet Instance

The Lifecycle of the helloWorld Application

Running the Application in NetBeans IDE

Further Information about JavaServer Faces Technology

5.  Introduction to Facelets

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 Is a JavaServer Faces Application?

The functionality provided by a JavaServer Faces application is similar to that of any other Java web application. A typical JavaServer Faces application includes the following parts:

  • A set of web pages in which components are laid out.

  • A set of tags to add components to the web page.

  • A set of backing beans which are JavaBeansTM components that define properties and functions for components on a page.

  • A web deployment descriptor (web.xml file).

  • Optionally, one or more application configuration resource files such as a faces-config.xml file, which can be used to define page navigation rules and configure beans and other custom objects such as custom components.

  • Optionally, a set of custom objects created by the application developer. These objects can include custom components, validators, converters, or listeners.

  • A set of custom tags for representing custom objects on the page.

Figure 4-1 describes the interaction between client and server in a typical JavaServer Faces application. In response to a client request, a web page is rendered by the web container that implements JavaServer Faces technology.

Figure 4-1 Responding to a Client Request for a JavaServer Faces Page
Diagram shows a browser accessing myfacelet.xhtml page using an HTTP Request and the server sending the rendered the HTML page using an HTTP Response.

The web page, myfacelet.xhtml, is built using JavaServer Faces component tags. Component tags are used to add components to the view (represented by myUI in the diagram), which is the server-side representation of the page. In addition to components, the web page can also reference objects such as the following:

  • Any event listeners, validators, and converters that are registered on the components

  • The JavaBeans components that capture the data and process the application-specific functionality of the components

On request from the client, the view is rendered as a response. Rendering is the process whereby, based on the server-side view, the web container generates output such as HTML or XHTML that can be read by the browser.