- This topic has 5 replies, 4 voices, and was last updated 20 years ago by Daniel Dumitriu.
-
AuthorPosts
-
jcguatemalaMemberHi friends!
I am new about JSF, but a followed thi basic tutorial to maka a login application with JSF, but always presents Cannot find FacesContext
I using Tomcat 5 like a example.
Thank for all
vtcoolMemberI am having the same problem, I followed the tutorial and I am using tomcat 5.5 and it keeps saying cannot find FacesContext. Can anyone help fix this problem we are having?
vtcoolMemberI have figured out how to solve this issue. Within the web.xml, I have changed the servlet mapping to use /faces/* and I have also included a index.jsp that would forward to faces/userLogin.jsp. Then I recycled Tomcat 5.5 and it works now. Hope this helps.
Daniel DumitriuMemberI’m sorry to have to say this, but…
Has anyone other than newbies (myself included) looked at this issue ?After trying and failing – twice – to reproduce the JSFLoginDemo in my own environment, I downloaded the project (JSFLoginDemoProject.zip), unzipped it in my workspace and imported as existing project. That worked.
What doesn’t work is the JSFLoginDemo application, once I tried to deploy it under JBoss or Tomcat.
Sure enough, the message is “Cannot find FacesContext” !Now, I know it can be forced to work in various ways and I know I should know a lot more about the JSP framework before looking at JSF. However, the tutorial not working “out-of the box” is not a good sign.
(… the incident does make me feel less ignorant:-)It would be … positive if someone could tell me/us what is wrong with the above mentioned procedure…
Thank you,
Daniel
——————
P.S.1. The environment is Eclipse 3.0.1 / MyEclipse 3.8.3
P.S.2. The same thing happened when I tryied the “Hello” micro-application from “JavaServerFaces in Action”
GregMemberDaniel,
Are you using the correctl URL to access the userLogin page? I used the jsfdemo tutorial and we able to replicate it exactly. I noticed that if you try to go directly to the userLogin.jsp page it give the “Cannot find FacesContext” exception. So be sure you are using the
http://localhost:8080/JSFLoginDemo/userLogin.faces
instead of
http://localhost:8080/JSFLoginDemo/userLogin.jsp
When have a PR in our system for modifiying the tutorial to make this distinction much more clear as many users have had this problem.
Daniel DumitriuMemberRIght,
I stand corrected.
(did I mention “newbies” in my post ?)
Thanks,Daniel
-
AuthorPosts