Win a copy of Machine Learning Systems: Designs that scale this week in the Scala forum
or Xamarin in Action: Creating native cross-platform mobile apps in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
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.
 
Bartender
Posts: 19448
88
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
 
Without deviation from the norm, progress is not possible - Zappa. Tiny ad:
Rocket Oven Kickstarter - from the trailboss
https://coderanch.com/t/695773/Rocket-Oven-Kickstarter-trailboss
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!