Eclipse - JavaServer Faces - Configuration
In some cases it can happen that your Eclipse Web Project did not support code completion in a JSP or JSF page.
This happens to me in a JSF Project with MyFaces and Facelets Support. I build up the project using Maven so the project build was sucessfull and the project works well on my server but typing code with Eclipse JSP Editor war extreamly annoying as Eclipse did not support my with code completion.
The reason was that the project facets for my project where broken and also MyFaces Support was not added to Eclipse correctly. Indeed it is necessary to configure the myfaces support in Eclipse manually and I am not sure if I was not intelligent enough or the Eclipse WTP is not so easy to use as I should be.
So follow these steps if you run into a similar problem :
- create a MyFaces Folder localy on your computer (e.g: /home/user/myfaces)
- move the MyFaces libs and tomahawk libs into a subfolder lib/ (e.g:/home/user/myfaces/lib)
- commons-beanutils-x.x.x.jar
- commons-codec-x.x.x.jar
- commons-collections-x.x.jar
- commons-digester-x.x.jar
- commons-discovery-x.x.jar
- commons-logging-x.x.x.jar
- myfaces-api-x.x.x.jar
- myfaces-impl-x.x.x.jar
- tomahawk-x.x.x.jar
- move the tld Files for myfaces and tomahawk in a /tlds subfolder (e.g./home/user/myfaces/tlds)
- myfaces-impl-x.x.x-tlddoc.jar
- tomahawk-x.x.x-tlddoc.jar
- Edit the JavaServer Faces LIbraries
- open Window->Preferences
- go to Web and XML > JavaServer Faces Tools > Libraries
- add a new library "MyFaces" with all the jar files moved before to your myfaces/lib folder
- add a new library "MyFacesTLD" with all the jar files moved before to myfaces/tlds folder
- Next edit the Project Facets of your Web Project (Select your project and open >Project Properties > click modify )
- if there is allready available a JavaServerFaces Support - remove JavaServerFaces 1.2
- add JavaServerFaces 1.2. support and press "next" button
- select option "Sever supplied JSF Implemenation" and add the component libraries configured before in the right part of the selection. This is the importend part! And I did not found this dialog after clicking on "finish"
After this stepps code competion works for my JSF Project. Notice that I work with maven and Maven integration in Eclipse is currently not the best. But maybe this instruction will help you...
Posted at 10:29AM Jun 22, 2008
Posted by: Ralph
Category: General
Posted by redMoon on January 20, 2009 at 04:53 PM GMT #
Posted by grüner tee on December 05, 2009 at 12:38 PM GMT #