facebook

‘Cannot Find Faces Context’ error

💡
Our Forums Have Moved

For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub

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

    bradm
    Member

    My reading suggests that the following entry in my web.xml file:

    <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.faces</url-pattern>
    </servlet-mapping>

    should result in a browser succesfully navigating this URL (with the .jsp extension):

    http://localhost:8080/MyApp/index.jsp.

    It doesn’t work, however: I get a message saying “Cannot find Faces context”. If I replace the .jsp extention with .faces in the URL, though, all is well.

    What am I doing wrong/missing?

    Thanks in advance.

    #236767

    Riyad Kalla
    Member

    My reading suggests that the following entry in my web.xml file:

    <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.faces</url-pattern>
    </servlet-mapping>

    should result in a browser succesfully navigating this URL (with the .jsp extension):

    bradm,
    That mapping suggests that *only* URLs ending in .faces will be forwared to your “Faces Servlet”, not .jsp. If you mapped *.jsp to your faces servlet, then yes, that would work, however the default behavior of JSF is to forward (after processing) to a page with the same name as the request URL but with the extension .jsp, so mapping .jsp to your faces servlet could likely create a endless cycle, but give it a try if you like.

    #237186

    loomax
    Member

    i think you have to call your page with http://localhost:8080/MyApp/index.faces

Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: ‘Cannot Find Faces Context’ error

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