Problems configuring JSF 2.0 on Eclipse Indigo
Asked Answered
R

1

5

I'm developing a web application with JSF 2.0 on the IDE Eclipse Indigo (the last version).

But on Project ->Properties -> Project Facets, the option JavaServer Faces is configured on version 1.2 and when I try to change the version to 2.0, an error message apears

Cannot change version of project facet JavaServer Faces to 2.0.

Strangely, the JSF libaries in my project are all the 2.0 version.

I think this is the problem that is causing my pages not to show simple xhtml tags like <h:outputLabel> and <h:inputText>.

The JSF libraries that I'm using was obtained on the Mojarra project 2.0.6

Hope someone could help me Thanks in advance

Romulus answered 17/11, 2011 at 17:49 Comment(0)
H
10

This is an Eclipse quirk. See also Eclipse bug 201792 which is never been fixed.

The only way to change the JSF Facet version is by editing the following line of the /.settings/org.eclipse.wst.common.project.facet.core.xml file

<installed facet="jst.jsf" version="1.2"/>

to

<installed facet="jst.jsf" version="2.0"/>

Other than that, you can also just ignore it altogether. Changing the version of that facet really doesn't do any new magic for you anyway. The final WAR build still contains the JSF 2.0 libs and if you have redeclared <faces-config> root declaration of /WEB-INF/faces-config.xml file to comply JSF 2.0, then there should be no problems. If you still encounter problems with using Facelets (XHTML files, as you say yourself), then you should ask a new and more specific question about that here.

Hylton answered 17/11, 2011 at 17:57 Comment(2)
Reading your lines I wonder why Eclipse does not offer JSF2 support. JSF2 is not that new.Joannejoannes
@Alex: Eclipse definitely supports JSF2 (since Helios SR2). This particular one is just a bug which makes developer unable to change JSF project facet version from 1.2 to 2.0 in an existing JSF 1.2 project. Creating a new JSF 2.0 project from the beginning on is not a problem.Hylton

© 2022 - 2024 — McMap. All rights reserved.