facebook

Cannot find FacesContext [Closed]

  1. MyEclipse IDE
  2.  > 
  3. Java EE Development (EJB, JSP, Struts, XDoclet, etc.)
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #218470 Reply

    jcguatemala
    Member

    Hi 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

    #218494 Reply

    vtcool
    Member

    I 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?

    #218500 Reply

    vtcool
    Member

    I 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.

    #222138 Reply

    I’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”

    #222202 Reply

    Greg
    Member

    Daniel,

    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.

    #222399 Reply

    RIght,

    I stand corrected.
    (did I mention “newbies” in my post ?)
    Thanks,

    Daniel

Viewing 6 posts - 1 through 6 (of 6 total)
Reply To: Cannot find FacesContext [Closed]

You must be logged in to post in the forum log in