Eclipse autocomplete (content assist) with facelets (jsf) and xhtml
Solution 1:
Found the solution pretty quickly after asking the question (and an hour after I started attempting to solve it):
Window > Preferences > General > Content Types > Text > JSP > Add (xhtml)
Makes the files be treated as jsp ones. Thus when they are opened with the JSP editor, the autocomplete of any tag library that has its definitions in .tld
format (<h:
and <f
for example) works. Facelets, and facelets-only tags still don't work. Their .tld
equivalents should be added somewhere in the projects. Facelet's tld can be found here.
Another, a bit more complex solution is described here.
Solution 2:
In Eclipse Indigo (3.7) adding *.xhtml as a jsp does not work.
Adding a project facet solves the issue:
Right click on the project -> Preferences -> Project Facets -> Click on "JavaServer Faces", version should most probably be 2.0.
Then it asks for a library, you can click on "disable...", because most probably you already would have the jars configured. I don't have mine as a library so I ignored that part.
Screenshot: