Miles to go ...

Arun Gupta is a GlassFish Evangelist focusing on Web Tier at Sun. He was the spec lead for APIs in the Java platform, committer in multiple Open Source projects, participated in standard bodies and contributed to Java EE and SE releases.
« FREE Sun Student... | Main | TOTD #48: Converting... »

http://blogs.sun.com/arungupta/date/20081014 Tuesday October 14, 2008

TOTD #47: Getting Started with Mojarra 2.0 nightly on GlassFish v2


Java Server Faces 2.0 specification (JSR 314, EDR2) and implementation (soon to be EDR2) are brewing. This blog shows how to get started with Mojarra - Sun's implementation of JSF.

GlassFish v2 comes bundled with Mojarra 1.2_04 which allows you to deploy a JSF 1.2 application. This blog explains how you can update GlassFish v2 to use Mojarra 2.0 nightly. And then it deploys a simple JSF 1.2-based application on this updated GlassFish instance, there by showing that your existing JSF 1.2 apps will continue to work with Mojarra 2.0-enabled GlassFish. This is an important step because it ensures no regression, unless it was a compatibility fix :)

  1. Re-create a simple JSF 1.2 application as described in TOTD #42, TOTD #45 and TOTD #46. This application allows to create a list of cities and store them in a backend database. It uses JSF Extensions to show suggestions, using Ajax, based upon the cities already entered and also uses Facelets as the view technology. Alternatively you can use any pre-existing JSF 1.2 application.
  2. Download Mojarra 2.0 latest nightly.
  3. Follow Release Notes to install the binary, the steps are summarized here for convenience (GlassFish installed in GF_HOME):
    1. Backup "GF_HOME/lib/jsf-impl.jar".
    2. Copy the new "jsf-api" and "jsf-impl" JARs from the unzipped Mojarra distribution to "GF_HOME/lib".
    3. Edit "GF_HOME/domains/<domain-name>/config/domain.xml" and add (or update the existing "classpath-prefix") 'classpath-prefix="${com.sun.aas.installRoot}/lib/jsf-api.jar" in the java-config element.
    4. Restart your server.
  4. Deploy the application on Mojarra 2.0-enabled GlassFish, that's it!
The application is accessible at "http://localhost:8080/Cities/faces/welcome.xhtml". Some of the screen captures are shown below.

If only "S" is entered in the city name, then the following output is shown:



Now with "San" ...



And another one with "De" ...



With JSF 2.0, Ajax capabilities and Facelets are now part of the specification and have already been integrated in Mojarra. A follow up blog entry will show how to use that functionality.

The downloaded Mojarra bundle has some samples (in "samples" folder) to get you started, have a look at them as well!

File JSF related bugs here using "2.0.0 EDR1" version and ask your questions on webtier@glassfish.dev.java.net.

Please leave suggestions on other TOTD (Tip Of The Day) that you'd like to see. A complete archive of all tips is available here.

Technorati: totd javaserverfaces glassfish mojarra netbeans

del.icio.us | furl | simpy | slashdot | technorati | digg |
|
Comments:

[Trackback] TOTD #47 showed how to deploy a JSF 1.2 application (using Facelets and Ajax/JSF Extensions) on Mojarra 2.0-enabled GlassFish. &nbsp;In this blog we'll use new features added in JSF 2.0 to simplify our application: Use integrated Facelets and resource...

Posted by Arun Gupta's Blog on October 15, 2008 at 05:40 AM PDT #

[Trackback] Yaaay, 50th tip!! The previous 49 tips are available here. Mojarra EDR2 is now available - download binary and/or source bundle! GlassFish v2 UR2 ships with Mojarra 1.2.0_04 and v3 prelude comes with 1.2.0_10. The Mojarra binaries in both...

Posted by Arun Gupta's Blog on October 23, 2008 at 08:35 AM PDT #

thanks.

Posted by izolasyon on November 02, 2008 at 11:29 PM PST #

webtier@glassfish.dev.java.net. get me back failure mail please check it.

Posted by Disney Wallpapers on March 08, 2009 at 02:31 PM PDT #

thank u. nice..

Posted by sinema izle on March 18, 2009 at 07:00 AM PDT #

Post a Comment:
  • HTML Syntax: NOT allowed
« FREE Sun Student... | Main | TOTD #48: Converting... »

Valid HTML! Valid CSS!

This is a personal weblog, I do not speak for my employer.