Problem

Using Eclipse Helios (3.6) and developing JSF 2.0 web application. In .xhtml file, when i pressed on the “Ctrl + Space” combination keys to call the code assist for JSF tag, it prompts nothing? It look like the code assist for JSF tag is not working properly in the .xhtml file extension?

技术分享

Solution

In Eclipse project, you have to make sure the project is supported the WTP and JSF capabilities.

1. Right click on the project, choose properties, select “Project Facets“, make sure the “JavaServer Faces” is checked. Later, click on the “further configuration…” link to configure the JSF capabilities.

技术分享

2. Create an user library and include the JSF API and implementation library, jsf-api-xxx.jar and jsf-impl-xxx.jar. It will add the JSF capabilities to your project.

技术分享

3. Done, in .xhtml file, click on the “Ctrl + Space” keys again, now it prompts the JSF tag code assist properly. Furthermore, it add JSF visual editor to the web page editor as well.

技术分享