• 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
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

JSF beginner error: Cannot find FacesContext

 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello guys,

I am finding the error "Cannot find FacesContext" while running my JSF webapp. I googled it and found that in most cases the error is regarding web.xml, right? Well I'm posting this because I think that is not my problem.

I start to prepare an application.. and I fix its web.xml and faces-config.xml. I add the necessary libs. Then, I write an index.jsp with only HTML contento on it. It runs ok.
But then if I change this jsp to one that has calls to JSF tags and it gives me the Cannot Find FacesContext error.

Will anyone help? Below go my files:

web.xml:




faces-config.xml:



The simple fact of putting a "<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>" line in the index.jsp causes the error.
Is it the right line to include? Is the http address correct?

Oh. And I have the following libraries added:
- commons-beanutils.jar
- commons-collections.jar
- commons-digester.jar
- commons-logging.jar
- jsf-api.jar
- jsf-impl.jar
- jstl.jar

Is there something wrong? hehehe
thanks
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you show the JSP file and also the URL you are using to access the page?

Thanks.
 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
what URL are you using to call this index.jsp?

If it is "..../index.jsp", then the JSF-lifecycle is not entered, and all JSF-tags cough up.
If it is "..../index.jsf" then the lifecycle is not entered because the web.xml has the not corresponding mapping...

If it is "..../faces/index.jsp" then the lifecycle is entered and therefor the message should not be shown.

hth
Alexander
[ May 15, 2006: Message edited by: Alexander Jesse ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic