JavaServer Faces (JSF) overview

JavaServer Faces (JSF) is a standard framework that simplifies the construction of user interfaces (UI) for server-based applications by enabling the assembly of reusable UI components in a page. JSF facilitates the connection of widgets to data sources and to server-side event handlers.

The JSF specification defines a set of standard UI components and provides an Application Programming Interface (API) for developing components or enables the reuse and extension of the existing standard UI components.

JSF reduces the effort in creating and maintaining applications that run on a Java™ application server and render application UI to a target client. It facilitates Web application development through:

JSF provides component tags for all input fields available and implements the Model-View-Controller (MVC) design framework ensuring that applications are well designed and easier to maintain. JSF allows Java programmers to focus on backend application development that is integrated with the UI. It allows Web page creators to create UI by assembling pre-built JSF components that already contain the necessary logic.

JSF Lifecycle

Each JavaServer Faces request that renders a JSP involves a JSF component tree, also called a view, and goes through a request processing life cycle made up of phases. The standard phases of the request processing life cycle begin with building the restore view, then request values are applied, validations are processed, model values are updated, and the application is invoked. Once the application is invoked a response is rendered. During several phases of the request processing life cycle, events can be queued. The queued events are broadcast to interested event listeners.

Diagram of JavaServer Faces lifecycle

JSF UI component model

JSF enables you to create Web application from collections of components that can render themselves in different ways for multiple client types. JSF provides:
  • A set of base UI components - standard HTML input elements along with a core library.
  • Extension of the base UI components to create additional UI component libraries or extend existing components.
  • Multiple rendering capabilities that enable JSF UI components to render themselves differently depending on the client type (for example HTML browser, wireless or WAP devise).

JSF Development overview

To create a JSF application:
  1. Define and implement the application Model classes.
  2. Describe the Model to the framework.
  3. Create application Views using JSPs.
  4. Define data validation rules.
  5. Define View navigation for the Controller
Related concepts
Asynchronous JavaScript and XML (AJAX) Components
Client-side data caching using Faces Client components
JavaServer Faces life cycle
Developing Web applications using JavaServer Faces (JSF)
JSF Widget Library (JWL)
Related reference
JavaServer Faces (JSF) components reference
AJAX components
Behavior components
Data viewing components
Input components
Navigation components
Output components
Page components
Panel components
Sub tags

Feedback