First JSF tutorial with Eclipse Neon, Tomcat 9

  1. In eclipse, Window/Show View/Servers
  2. If you have a working Tomcat in Eclipse, go to step 6.
  3. Download and unzip Tomcat 9 anywhere on your computer.
  4. If this is a new Eclipse and no Tomcat is already in the Servers tab window, right click on that window, select New Server.  Select Tomcat vX.x Server which is the version Tomcat you downloaded and unzipped. Click Next
  5. Click Browse to fill in the directory where you downloaded Tomcat.  Click finish.
  6. In Eclipse, create a new Dynamic Web Project; here is one way: File / New / Project / Web / Dynamic Web Project.  Next.
  7. ProjectName: JsfTut.  Configuration:  Click Modify button. (On old versions of Eclipse, we just selected the Jsf2.2 config, no modify, no save).  Select Java Server Faces v2.2.  Click Save As.  Name it MyJsf2.2Config.  You’ll be using this config in future JSF projects.
  8. Hit Next until you get to the JSF Capabilities screen.
  9. Type: User Library.  Below it, right click (or click the download button beside it) and download library for JSF 2.2.  Also before clicking finish, highlight *.faces and click the Remove button to remove any mapping patterns that are there.  Click the Add button and add *.jsf     Now click finish.
  10. In Project Explorer, expand your new project.  Navigate to WebContent/WEB-INF, and right-click on web.xml.  Open With/Text Editor.
  11. Add the lines listed below into web.xml just before the web-app closing tag
  12. Now we’ll create a home page of type xhtml.  Right-click on the project name in Project Explorer: JsfTut.  New/Html File/index.xhtml.  Click finish.  Delete its contents and replace them with the contents in the second piece of code below
  13. It’s ready to run.  Eclipse can show the web page but it will take a minute.  Right click on the project name (JsfTut)/ Run As/Run on Server/ Select the Tomcat Version and proceed.  In Eclipse, the web page should say “Congrats this works”.  If it worked for you, show some luv, and leave a comment below. 🙂

    Congrats, this works!



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html xmlns=""
<h1>Congrats, this works!</h1>


About SunKing2

Former web developer, guitar player, started Piano 2012 -yes still doing it! Recovery, sobriety, mental health advocate.
This entry was posted in Uncategorized. Bookmark the permalink.

1 Response to First JSF tutorial with Eclipse Neon, Tomcat 9

  1. Pingback: Second JSF Tutorial with Eclipse, Tomcat | Connected Web

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s