JSF editor autocomplete (xhtml) for STS 4

2019-08-16 13:50发布

问题:

I'm working on a PrimeFaces (6.2) project.

I wanted to start using Spring Tool Suite (STS) 4, but I realized very early that it is not working as it used to in STS 3. Specifically support for JSF seems to be missing and so autocomplete doesn't work with xhtml source files.

This answer was an inspiration and I found, that same project facets in STS 3 looks like:

while the same for STS 4 is

which seems like root cause for missing autocomplete.

I have no idea how to fix that.

What I used to do

  1. downloaded STS
  2. download the project (from SVN, Git, ...)
  3. run mvn clean install
  4. run mvn eclipse:eclipse (to prepare Eclipse project)
  5. import project to Eclipse (STS)

and that was it. It was ready, but the same is not working for STS 4.

As an easy-to-start-with project (PrimeFaces + Spring Boot) I like JSF PrimeFaces HelloWorld

Additional info

I installed JST Tools via Eclipse Marketplace searching for WST (select the one for Java EE as there is JSF and JSP support).

On Confirm Selected Features I selected JSF Tools - Web Page Editor as proposed...

At the end the project facets are not the same as in STS 3 (I deleted .setting/, .classpath, .project and executed mvn eclipse:eclipse again)

but code completion is working, so I'm fine.

回答1:

In Eclipse JSF is supported not via STS, but via the Eclipse WTP JavaServer Faces (JSF) Tools.

For Spring and JSF support install STS 4 into the Eclipse IDE for Enterprise Java Developers (which contains Eclipse JSF Tools) or install the Eclipse Java EE Developer Tools into an Eclipse IDE with STS 4 but without JSF support.