Wednesday Nov 19, 2008

TOTD #54: Java Server Faces with Eclipse IDE

Ed pointed me to this excellent tutorial that explains how JavaServer Faces applications can be easily created using Eclipse IDE. The article clearly shows all the steps to create a Java Server Faces application and demonstrates the following JSF concepts:
  • How to register managed beans to a JSF application ?
  • Different templates for creating JSF pages
  • Validators
  • Resource Bundles
  • Navigation rules in faces-config.xml (very intuitive and easy-to-use)
  • Dependency injection
  • Value and Method Binding
Few code/snapshot mismatches but knowing that it's only version 0.3, it's a damn good job!

Couple of differences from the article:

First, I deployed all the samples on GlassFish v3 Prelude which has Mojarra 1.2 baked in. The screencast #28 explains how to configure GlassFish with Eclipse IDE.

Secondly, instead of using WTP, I used Eclipse 3.4 for Java EE developers which has built-in support for JSF 1.1 and 1.2 applications. So there is no need to download/configure JSP/JSTL libraries. Instead the libraries are specified during project creation as shown below:

And then let the server side provide JSF implementation by selecting radio button as shown below:

That's it, now the Mojarra baked in GlassFish v3 Prelude is used for JSF runtime.

The faces-config editor is really cool, intuitive and easy-to-use. Here is a snapshot:

Here is a snapshot of the project explorer window (package names are different from the original article):

And now finally the outputs from 4 JSF applications:

All of this using Mojarra and GlassFish v3 Prelude :)

Let us know your feedback on Mojarra at GlassFish Webtier forum, file bugs in Issue Tracker, and find the latest information about Mojarra at

Technorati: totd javaserverfaces eclipse glassfish v3 mojarra

profile image
Arun Gupta is a technology enthusiast, a passionate runner, author, and a community guy who works for Oracle Corp.

Java EE 7 Samples

Stay Connected


« November 2008 »