• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
stefano corna
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 18098
50
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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")
 
stefano corna
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic