Home arrow Java arrow Introducing Java Server Faces (JSF)

Introducing Java Server Faces (JSF)

This article will introduce you to Java Server Faces, including the terminology, how to set it up, and using it in the real world.

Author Info:
By: A.P.Rajshekhar
Rating: 5 stars5 stars5 stars5 stars5 stars / 26
October 17, 2006
  1. · Introducing Java Server Faces (JSF)
  2. · JSF: Terminology Continued
  3. · JSF: Steps for Implementation
  4. · JSF in the Real World

print this article

Introducing Java Server Faces (JSF)
(Page 1 of 4 )

The event driven paradigm has been considered the forte of desktop applications for a long time. Though web applications have HTML to present the user with buttons and other familiar GUI elements, the developer has to work with the request-response paradigm. However, server-side development is slowly shifting towards the event driven paradigm. Frameworks are accelerating this shift by abstracting out the difficulties of constructing an event-handling layer over a request-response layer.

In the context of J2EE or JEE, the framework that is providing an event-based development platform is Java Server Faces, or JSF as it is popularly known. In this discussion I will be focusing on the basics of JSF. The first and second sections will cover the terminology associated with JSF. In the third section, I will enumerate the steps required for setting up the arena for JSF. In the last section I will implement a real world solution using JSF. That outlines the agenda for this discussion. 

JSF: Understanding the Terminology

Whenever a new framework comes into being, it brings a plethora of new terms and vocabulary with it. JSF doesn't contradict this generalization. However, in the case of JSF, its terminology is also its components. In other words, one cannot develop using JSF without understanding the terms, because they are the pieces of the puzzle called JSF. The following are the main components that make JSF:

  1. UI Components
  2. Renderer
  3. Validator
  4. Backing Beans
  5. Converter
  6. Events and Listeners
  7. Messages
  8. Navigation

If you observe carefully, you will see that the first, fourth and sixth components are present in one form or another while working with any event driven toolkit, but the second, third and fifth are additions to JSF. The seventh and eighth are the demands of any web framework. Here are the details.

UI Components

UI Components are also known as controls or simply components. A component is a stateful object. It is built atop JavaBeans. In other words, a UI Component has properties, events and methods. The obvious question here is, what is the difference between a JSF UI Component and a Swing component? The answer is that JSF UI Components have been chosen with server side constraints in mind, and these components live on server-side not on the client side.

The other important thing to keep in mind is that web applications can never be built using components. The components themselves are not shown on the client-side, but they output the HTML which is then interpreted by the browser and shown to the user as GUI elements. In other words, the UI Components are rendered for the browser. A UI Component can be represented in many ways. How it is shown is decided by Renderer.


A component cannot render itself. It is the responsibility of the Renderer to display the component and translate the user input values into the values understandable by the component. A single Renderer can work with multiple components, and a component can work with many Renderers. In short, UI Components and Renderers have a many-to-many relationship. A Renderer can be thought of as a translator between the client and the server. The main thing to keep in mind about Renderers is that custom renderers can be hooked to existing UI Components.

blog comments powered by Disqus

- Java Too Insecure, Says Microsoft Researcher
- Google Beats Oracle in Java Ruling
- Deploying Multiple Java Applets as One
- Deploying Java Applets
- Understanding Deployment Frameworks
- Database Programming in Java Using JDBC
- Extension Interfaces and SAX
- Entities, Handlers and SAX
- Advanced SAX
- Conversions and Java Print Streams
- Formatters and Java Print Streams
- Java Print Streams
- Wildcards, Arrays, and Generics in Java
- Wildcards and Generic Methods in Java
- Finishing the Project: Java Web Development ...

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 

Developer Shed Affiliates


© 2003-2019 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials