facebook

Problems getting JSF (*.faces) to work correctly in web.xml

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

    paulbhart
    Member

    Using Tomcat 5.0
    Eclipse 3.0

    I have created a very simple example application (2 files in web root)
    one [filename].faces and one [anotherfilename].jsp. When I point my
    browser at [filename].faces file, it takes a while and then
    I get an 404 error about not being
    able to access [filename].jsp If I try a [anotherfilename].jsp it works
    fine. The weird thing is it seems to work fine if I configure web.xml
    to look for /faces/* instead of either *.jsf or *.faces

    Here is my web.xml file

    <?xml version=”1.0″ encoding=”UTF-8″?>
    <web-app xmlns=”http://java.sun.com/xml/ns/j2ee&#8221; xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance&#8221; version=”2.4″ xsi:schemaLocation=”http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd”&gt;
    <servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <init-param>
    <param-name>config</param-name>
    <param-value>/WEB-INF/faces-config.xml</param-value>
    </init-param>
    <init-param>
    <param-name>debug</param-name>
    <param-value>3</param-value>
    </init-param>
    <init-param>
    <param-name>detail</param-name>
    <param-value>3</param-value>
    </init-param>
    <load-on-startup>0</load-on-startup>
    </servlet>
    <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.faces</url-pattern>
    </servlet-mapping>
    </web-app>

    #218948 Reply

    paulbhart
    Member

    another piece of information making me think it might be in the configuration of tomcat.

    I can interject errors into the *.faces, *.jsp files (both jsp and jsf errors) and I still only
    get the 404 error. Making me thing that the servlets for jsp and jsf aren’t even getting
    called prior to tomcat issuing the 404 error . . .

    #218981 Reply

    paulbhart
    Member

    Never mind, figure it out, nothing here but 😳

Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: Problems getting JSF (*.faces) to work correctly in web.xml

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