Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Problems configuring JSF 2.0 on Eclipse Indigo

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

like image 724
gpp Avatar asked Nov 17 '11 17:11

gpp


1 Answers

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.

like image 95
BalusC Avatar answered Sep 24 '22 03:09

BalusC