Good code is its own best documentation. As you're about to add a comment, ask yourself, "How can I improve the code so that this comment isn\'t needed?" Improve the code and then document it to make it even clearer.

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) :

  1. Right click on the project, choose “properties” –> “Project Facets“.
  2. Check “Dynamic Web Module“, select version 2.5.
  3. Check “Java“, choose version 1.6.
  4. Check “JavaServer Faces“, choose version 2.0.
    eclipse-jsf-support
  5. Click on the “further configuration…” link below to do the JSF configuration.
  6. Create an user library and include the JSF 2.0 API and implementation libraries, jsf-api-xxx.jar and jsf-impl-xxx.jar.
    eclipse-jsf-support
  7. Done.

3. Demo


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.

eclipse-jsf-support


  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  




affiliate_link