Before you start
This tutorial provides an overview of JavaServer Faces (JSF) and presents the basics for developing Web applications using the technology. JSF is a standard UI framework and is designed to ease the burden of developing applications that run on a Java application server and render UIs back to a target client. Development of the technology is being led by Sun Microsystems as JSR 127 under the Java Community Process.
As you work through the tutorial you will examine the JSF life cycle, input validation, event handling, page navigation, and internationalization -- all of which are illustrated through a sample application.
This tutorial is intended for Java server-side developers with a good understanding of the Java language and a working knowledge of JSP technology.
After completing this tutorial, you should have a solid understanding of JavaServer Faces and will able to develop robust Web applications that use JSF.
In order to build, deploy, and run JavaServer Faces applications, you need the Java Web Services Developer Pack (Java WSDP) or Apache Tomcat (version 4.0 or above) with JSF taglibs.
To proceed with this tutorial, you should download and install Java WSDP 1.2. This distribution bundles JavaServer Faces 1.0 Early Access Release (EA4), the Tomcat 5 development container, and many other components. You also need J2SE SDK version 1.3 or above.
Set your environment variables as follows:
- Set
JAVA_HOMEto your J2SE SDK installation directory. - Set
JWSDP_HOMEto your Java WSDP 1.2 installation directory. - Set
ANT_HOMEto$JWSDP_HOME/apache-ant(under Unix or Linux) or%JWSDP_HOME%\apache-ant(under Windows). - Set
JSF_HOMEto$JWSDP_HOME/jsf(under Unix or Linux) or%JWSDP_HOME%\jsf(under Windows).
Checking your JSF installation
On a UNIX or Linux platform, run the script $JWSDP_HOME/bin/startup.sh to start Java WSDP. On a Windows platform, run %JWSDP_HOME/bin/startup.bat or select Programs > Java Web Service Developer Pack 1.2 > Start Tomcat from the Start menu to bring up the server.
After the server is running, point your browser to http://localhost:8080/ or http://127.0.0.1:8080.
You should see the Java WSDP home page. Now, try to execute some JSF examples by following the links under the heading "JSF Examples." If there are no errors, you have successfully set up JSF.




