Thodoris Bais

About Thodoris Bais

Thodoris Bais is currently working as a Junior Java Developer while on parallel, pursuing a diploma at Informatics & Telecommunications Engineering. He specializes in Java Core, Android and J2EE and looks forward to being a successfull professional. He is interested in entrepreneurship and is also a quick learner and curious about new technologies.

JSF 2.0 Eclipse IDE support

As the title clarifies, in my very first tutorial, we are going to take a glance at setting our Eclipse IDE, in order to support JSF 2.0.

Οlder Eclipse EE versions, such as Ganymede (v3.4) and Galileo (v3.5), support only JSF 1.2. In order to work with JSF 2.0, you just have to own an Eclipse EE version of Helios (v3.6) or onward, which has by default full support of Java EE 7, including JSF 2.0.

Here’s the guide that will show you how to enable JSF 2.0 features in your Eclipse IDE.

Tools Used :

  • Eclipse EE Kepler (v 4.3)
  • JSF 2.2

1. Eclipse Project Facets

First, we have to create a JSF custom library, which will be available each time we want to cooperate with JSF. The most common and easy way to do this, is to configure an existing project, in order to support Web Tools Platform (WTP).

Steps to enable the Web Tools Platform (WTP) :

  1. Right click on an existing project and select Properties
  2. While on Properties window, select Project Facets
  3. Make sure that the version of your Dynamic Web Module is at least 2.5
  4. Tick the Java checkbox and select the 1.6 (or 1.7 l it depends on what is the latest version of Java that you have installed) version.
  5. Tick the JavaServer Faces checkbox and select 2.2 version.

You should now be informed that a further configuration is required. Hover over the link and click it!

image1u

Now it’s the time to create our stable User Library:

  1. In the Modify Faceted Project window, click the download icon

configureJSF_2u

You should at least see a JSF 2.2 library, as shown below (here, we do not have any other available views, because our example pc already supports 2.0, as you correctly noticed) :

configureJSF_3u

  1. Click Next, accept the License Agreement and hit Finish
  2. Check JSF 2.2 (Mojarra 2.2.0) and hit OK.

configureJSF_4u

2. Demo

Success!You just accomplished to configure JSF 2.2 on Eclipse IDE!. Let’s try it out, by creating a sample .xhtml file, which will be the very first page in our website.
I’m sure you know hot to implement such an easy action, but just to follow along:

  • Right click the project’s Web Content folder.
  • Hit New => HTML File.
  • Name your file index.xhtml
  • Select the 1.0 strict xhtml template and hit Finish

And a small annotation : if you want to make your life easier, especially according to the front-end part of your application, Eclipse EE also provides a Web Page Editor. Let’s see what I mean :

  • Right click on the index.xhtml you just created.
  • Select Open With => Web Page Editor.

Yeah, that’s it! This view provides a full Web Palette to assist you while developing your J2EE applications! Just in case you didn’t noticed what happened, here is the exact screenshot :

configure_JSF5u

What comes after configuring? Getting up and running, of course ; and you guessed it right, the fore-mentioned picture is from next example’s JSF application.

This was an example of configuring Eclipse IDE in order to support JSF 2.0.

So, in our next JSF example, we ‘ll find out how to develop a simple Hello World application. Stay tuned!

Do you want to know how to develop your skillset to become a Java Rockstar?

Subscribe to our newsletter to start Rocking right now!

To get you started we give you two of our best selling eBooks for FREE!

JPA Mini Book

Learn how to leverage the power of JPA in order to create robust and flexible Java applications. With this Mini Book, you will get introduced to JPA and smoothly transition to more advanced concepts.

JVM Troubleshooting Guide

The Java virtual machine is really the foundation of any Java EE platform. Learn how to master it with this advanced guide!

Given email address is already subscribed, thank you!
Oops. Something went wrong. Please try again later.
Please provide a valid email address.
Thank you, your sign-up request was successful! Please check your e-mail inbox.
Please complete the CAPTCHA.
Please fill in the required fields.
Examples Java Code Geeks and all content copyright © 2010-2014, Exelixis Media Ltd | Terms of Use | Privacy Policy
All trademarks and registered trademarks appearing on Examples Java Code Geeks are the property of their respective owners.
Java is a trademark or registered trademark of Oracle Corporation in the United States and other countries.
Examples Java Code Geeks is not connected to Oracle Corporation and is not sponsored by Oracle Corporation.
Do you want to know how to develop your skillset and become a ...
Java Rockstar?

Subscribe to our newsletter to start Rocking right now!

To get you started we give you two of our best selling eBooks for FREE!

Get ready to Rock!
You can download the complementary eBooks using the links below:
Close