Skip to content

JSF 2 Eclipse Tomcat 7

February 24, 2011
  1. Download JDK 6 to for example C:\java\jdk6
  2. Download Tomcat 7 from http://tomcat.apache.org/download-70.cgi – select the zip option under Core.  Unzip into for example C:\apache-tomcat-7.0.8.
  3. Download Mojarra JSF implementation 2 from http://javaserverfaces.java.net/.  Unzip into for example c:\mojarra-2.0.4-FCS. The required jars are inside the lib folder here.
  4. Start eclipse Helios.  Select New–>Other–>Web–>Dynamic Web Project. Give a project name Example.  Create a new runtime. Point to Tomcat version 7.  Check create new local server. For the location of the tomcat installation use C:\apache-tomcat-7.0.8 from #2 above. Tomcat needs an SDK. So point the  JDK location from #1 above while setting up Tomcat runtime in the New Server Runtime Environment screen. 
  5. Select Dynamic web module version as 3.0 and Configuration as Java Server Faces version2.0 project.
  6.  Clicking next, check Generate web.xml.
  7. Clicking next, JSF implementation library select user library manager libary icon. Create new user library add the JSF libraries from  #3. Name the library as JSF2.0. Check this as the JSF implementation for the project. Click finish.
  8. I also added el-impl.jar, jstl1.2 jars to WEB-INF\lib folder in the eclipse project.
  9. Right click on the project Example –>Properties–> Java Build Path–>Source. Change the default output folder to Example/WebContent/classes. This makes the backing beans to be deployed correctly.
  10. Now you are ready to write facelets based JSF applications.

From → JSF

One Comment

Trackbacks & Pingbacks

  1. JPA in Tomcat 7 « raj narayanamurthy's

Leave a comment