Thursday, November 05, 2009

Editing .xhtml for JSF + Facelets on Eclipse 3.4

With standard installation of current eclipse-version it isn't possible to work well with JSF+Facelets, because of the missing content assist in standard-editor for xhtml-pages.
The easiest way to solve this issue is to make the XML-editor to standard editor for xhtml-pages.
Got to Windows->Preferences->General->File Associations. Look for .xhtml-Files and add the XML-editor. Finally make the XML-editor the default editor for this filetype.

Moreover you should add .xhtml to JSP-content type:
Windows->Preferences->General->Content Types->Text->JSP (add .xhtml)


For facelets content assist (supporting the ui:-tag, namespace "http://java.sun.com/jsf/facelets") , you probably need the jsf-ui.tld. Put it to your project WEB-INF/ or WEB-INF/tld directory.