How to make Eclipse IDE supports JSF 2.0
In Eclipse Ganymede (v3.4) or Galileo (v3.5), it has supports for JSF 1.2 only. For JSF 2.0, it’s recommended to upgrade the Eclipse to the latest version, Helios (v3.6), it has full support of Java EE 6 support, including JSF 2.0.
Here’s a quick guide to show how to enable the JSF 2.0 features in Eclipse project.
1. Eclipse Helios
Download the latest Eclipse IDE for Java EE Developers, Helios (v3.6).
2. Project Facets
To support JSF 2.0, you have to configure your Eclipse project to support Web Tools Platform (WTP).
Steps to enable the Web Tools Platform (WTP) :
- Right click on the project, choose “properties” –> “Project Facets“.
- Check “Dynamic Web Module“, select version 2.5.
- Check “Java“, choose version 1.6.
- Check “JavaServer Faces“, choose version 2.0.
- Click on the “further configuration…” link below to do the JSF configuration.
- Create an user library and include the JSF 2.0 API and implementation libraries, jsf-api-xxx.jar and jsf-impl-xxx.jar.
Now the Eclipse project is support the JSF 2.0 capabilities. In .xhtml file, click on the “Ctrl + Space“, it will prompts the JSF 2.0 tags (code assist) automatically. Furthermore, it add JSF 2.0 visual components to the web page editor as well.