Skip to main content

By clicking Submit, you agree to the developerWorks terms of use.

The first time you sign into developerWorks, a profile is created for you. Select information in your profile (name, country/region, and company) is displayed to the public and will accompany any content you post. You may update your IBM account at any time.

All information submitted is secure.

  • Close [x]

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerworks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

By clicking Submit, you agree to the developerWorks terms of use.

All information submitted is secure.

  • Close [x]

Getting started with JavaServer Faces 1.2, Part 2: JSF life cycle, conversion, validation, and phase listeners

Richard Hightower
Rick Hightower serves as chief technology officer for ArcMind Inc.. He is coauthor of the popular book Java Tools for Extreme Programming and coauthor of Professional Struts and Struts Live. Rick is the founding developer on the Crank project, a JSF/Facelets, Ajax, CRUD framework for idiomatically developing GUIs.

Summary:  This tutorial series covers how to get started with Java™ Server Faces (JSF) technology, a server-side framework that offers a component-based approach to Web user-interface development. Part 1 gets you started with a JSF 1.2 overview and a basic application. This sequel gives you a firm grasp of JSF's more-advanced features: custom validators, converters, and phase listeners. Along the way you'll gain an understanding of the JSF application life cycle.

View more content in this series

Date:  29 Jan 2008
Level:  Introductory PDF:  A4 and Letter (386 KB)Get Adobe® Reader®

Activity:  60187 views
Comments:  

Before you start

About this series

Get an introduction to Java™ Server Faces (JSF) technology, a server-side user-interface component framework for Java-based Web applications. This series is for developers who are new to JSF and want to come up to speed quickly — not just with JSF, but with using JSF components to reduce effort. This series covers just the essentials, with lots of examples.

JSF is a more-traditional GUI development environment like AWT, SWT, and Swing. One of its major benefits is that it makes Web development easier by putting the hard work on the framework developers, not the application developers. Granted, JSF itself is more complex than many other Web frameworks, but the complexity is hidden from the application developer. It is much easier to develop Web applications in JSF than in most other frameworks: it requires less code, less complexity, and less configuration.

If you are doing Java server-side Web development, JSF is the easiest framework to learn. It is geared for creating Web applications (not Web sites). It allows you to focus on your Java code without handling request objects, session objects, or request parameters, or dealing with complicated XML files. With JSF, you can get more things done more quickly than with other Java Web frameworks.


About this tutorial

This tutorial picks up where Part 1 leaves off. If you are new to JSF or just want a refresher, then read the first installment before you begin this one. Even if you are an old JSF pro, there is likely a gem or two in that will help you out.

Although tool support is a main benefit of JSF, you won't use fancy tools or IDE support in this tutorial. This tutorial covers the essentials with just background information to keep the discussion going and to keep you productively learning to use JSF to build Web applications.


Objectives

In this tutorial, continue getting an overview of JSF's features, and learn how to work with all of the JSF components. Build a simple contact-management application — a basic CRUD (create, read, update, delete) listing. After learning about the JSF application life cycle, improve the application with custom converters and validators. The tutorial winds down with a taste of some advanced JSF programming: create an object-level validation framework using a phase listener.


Who should take this tutorial?

If you are new to JSF, this tutorial is for you. Even if you have used JSF but have not tried out the JSF 1.2 features or have only used GUI tools to build JSF applications, you will likely learn a lot from both tutorials in this series.


Prerequisites

This tutorial is written for Java developers whose experience is at a beginning to intermediate level. You should have a general familiarity with using the Java language, with some GUI development experience.


System requirements

To run the examples in this tutorial, you need a Java development environment (JDK) and Apache Maven. It helps to also have a Java IDE. Maven project files and Eclipse Java EE and Web Tools Project (WTP) project files are provided. See Download to obtain the example code. Visit the author's companion site (see Resources) for additional information about how to run the examples.

1 of 11 | Next

Comments



static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Java technology, Web development
ArticleID=284805
TutorialTitle=Getting started with JavaServer Faces 1.2, Part 2: JSF life cycle, conversion, validation, and phase listeners
publish-date=01292008
author1-email=rhightower@arc-mind.com
author1-email-cc=jaloi@us.ibm.com

IBM SmartCloud trial. No charge.

IBM PureSystems on a kaleideoscope background

Unleash the power of hybrid cloud computing today!


Special offers