eclipse的html代码辅助失效解决办法

时间:2021-06-20 22:17:50

Eclipse IDE : .xhtml code assist is not working for JSF tag

By mkyong | September 6, 2010 | Viewed : 36,074 times

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?

eclipse的html代码辅助失效解决办法

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.

eclipse的html代码辅助失效解决办法

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.

eclipse的html代码辅助失效解决办法

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.

eclipse的html代码辅助失效解决办法