Tuesday, May 10, 2011

How to enable JSF auto completion support in Eclipse

Currently i have a project using JSF 2.0 with Spring integration. And using several cool framework like Primefaces I really a auto completion when working with .xhtml (Facelets)

I'm staring a project as Maven project web app. Then i create the web page in .xhtml

<html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:p="http://primefaces.prime.com.tr/ui">


</html>

I want when I type <p: and press Ctrl + Space, it should show the auto completion to help my work.

The steps are very easy:
  1. Download Eclipse bundle release Helios
  2. Goto your project, right click, then click on Properties
  3. Goto Project Facest (see left menu)
  4. Convert the project, choose the configuration as JavaServer Faces 2.0 Projects
  5. Applying to your project (the eclipse will rebuild your project)
  6. Done!

No comments: