Posts

Showing posts from 2009

JSF 2.0 with Maven 2 plugins for Glassfish v3, Jetty and Tomcat

In this post I'm going to demonstrate how JSF 2.0 "Hello World" application could be developed with the Maven 2 plugins for Jetty, Tomcat and Glassfish v3. The application consists of two pages and request scoped managed bean. The first page (hello.xhtml ) asks the user "What's your name?", validates the input , then the second page ( response.xhtml) greets the user with "Hi". The two pages share common layout defined in template.xhtml and request scoped managed bean HelloWorld.java exposed under name "hi". The titles of the pages are set with UL expression #{hi.greetFrom('greeting passed as parameter')}. The template loads its css and also one image file with the new ResourceHandler API.

Prerequisites:
* Basic knowladge of Java and Maven 2.
* Installed Maven 2 ( http://maven.apache.org ). The sample was tested with version 2.2.1

Quick start:
The source can be downloaded from here.

or could be checkout with subversion from:
http://sandc…