aspose file tools*
The moose likes IDEs, Version Control and other tools and the fly likes No access to JSF components in XHTML file and EL expression doesn't work in Eclipse Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "No access to JSF components in XHTML file and EL expression doesn Watch "No access to JSF components in XHTML file and EL expression doesn New topic
Author

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

Volodymyr Levytskyi
Ranch Hand

Joined: Mar 29, 2012
Posts: 505
    
    1

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).


True person is moral, false is right!
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16055
    
  21

This isn't a JSF problem, it's an IDE problem. Moving to IDEs Forum.


Customer surveys are for companies who didn't pay proper attention to begin with.
Volodymyr Levytskyi
Ranch Hand

Joined: Mar 29, 2012
Posts: 505
    
    1

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
William P O'Sullivan
Ranch Hand

Joined: Mar 28, 2012
Posts: 859

Thanks for sharing your solution!

WP
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: No access to JSF components in XHTML file and EL expression doesn't work in Eclipse