• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

No access to JSF components in XHTML file and EL expression doesn't work in Eclipse

 
Ranch Hand
Posts: 514
1
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have my managed bean added correctly in faces-config.xml.
EL expression works in "New JavaServer Faces (JSF) Page (xhtml, xml syntax)" (I have this option after I select new JSP file) but not in "New Facelet Footer" (when I select new HTML) page!
When I create html page with "New Facelet Footer" I have to add next lines but it doesn't give needed jsf components via Content Assist

I take any possible option to create html with JSF like: "New Facelet Composition Page", "New Facelet Footer", "New Facelet Header", "New Facelet Template" but in any case I don't have EL expression working.
With classpath I have everything good because I have access to jsf components in jsp file.
When I create "New JavaServer Faces (JSF) Page (xhtml, xml syntax)" I have access to all jsf components (h: and f: libraries) and EL expression works well
but when I open my ready page in System editor it prints that there is mistake on line 2 column 2. Here is my small JSP file:

Here is what I have in System Editor:

Please, tell how you create new HTML page(but not jsp) with jsf components, if it is possible of course, or maybe you know what to do with mistake
on column 2 line 2. I have el expression working only on "New JavaServer Faces (JSF) Page (xhtml, xml syntax)" (after I select new JSP file in "Select a wizard" dialog).
 
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This isn't a JSF problem, it's an IDE problem. Moving to IDEs Forum.
 
Bin Smith
Ranch Hand
Posts: 514
1
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This problem is solved now!

I had to do the following things to enable EL expressions:

1) place my project into workspace(File -->Switch Workspace) but not import it from anywhere
2) then import project into eclipse using File -->Import -->Import existing Maven project
3) add managed bean in Managed Bean tab in faces-config.xml. To have this faces-config.xml you should do the following:

a) right click on name of project. Choose "Properties". There select node Project Facets. In window on the right select following check boxes: Java, JavaScript, JavaServer Faces, Dynamic Web Module! Click OK. In WEN-INF you should see faces-config.xml with many tabs below. Select "Managed Bean" tab and add your managed bean.

To make all this work I also had to download "apache-maven-3.0.4" version. Then I had to add this new version to eclipse doing this:
Window -->Preferences -->Maven -->Installations --> Add(button).
Also I had to change location of .m2/repository from C://Documents and Settings/Admin/ and specify new location in User Settings(located below Installations)
To change location of maven repository it is needed to add following element to settings.xml under {maven-home}/conf directory

because I moved repository to D:/.m2/repository
 
Ranch Hand
Posts: 859
IBM DB2 Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for sharing your solution!

WP
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic