This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes JSF and the fly likes jsf problem , java.lang.RuntimeException: Cannot find FacesContext error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "jsf problem , java.lang.RuntimeException: Cannot find FacesContext error" Watch "jsf problem , java.lang.RuntimeException: Cannot find FacesContext error" New topic
Author

jsf problem , java.lang.RuntimeException: Cannot find FacesContext error

stefano corna
Greenhorn

Joined: Sep 08, 2010
Posts: 4
hi,
i just started work with jsf with eclipse and i need help to solve a problem.
i use Eclipse Elios, Tomcat 6.0 and JFS 1.2 (SUN version)
heres what i done
i created a new dynamic web project with eclipse, with javaserver faces 1.2 runtime and i added the relative jars (jsf-api jsf-impl and jstl-api-1.2).
i created a new jsp page with "New javaserver faces (JSF) Page (html)" template and added in it a simple empty table from the palette.
i generated the war fime and mounted on apache tomcat but it give me this error:
java.lang.RuntimeException: Cannot find FacesContext

follow the full error trace and java code in my project:


ERROR:



JSP FILE:



web.xml and faces-config.xml



someone have idea of what that error mean and what i should do?
tnx in advice.
regards.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16901
    
  26

It looks like you're confusing the resource path with the URL. Only URLs that match the mapping(s) you set up for the FacesServlet in web.xml are routed to the FacesServlet, and only the FacesServlet provides the FacesContext.

In other words, instead of asking for the resource ("/mywebapp/prova.jsp"), you need to ask for the URL ("http:/mywebapp/faces/prova.jsp")

Customer surveys are for companies who didn't pay proper attention to begin with.
stefano corna
Greenhorn

Joined: Sep 08, 2010
Posts: 4
Tim Holloway wrote:It looks like you're confusing the resource path with the URL. Only URLs that match the mapping(s) you set up for the FacesServlet in web.xml are routed to the FacesServlet, and only the FacesServlet provides the FacesContext.

In other words, instead of asking for the resource ("/mywebapp/prova.jsp"), you need to ask for the URL ("http:/mywebapp/faces/prova.jsp")


ty now it works
 
 
subject: jsf problem , java.lang.RuntimeException: Cannot find FacesContext error
 
It's not a secret anymore!