2

I develope a simple project. I use JSF + Spring frameworks. My JSF web application shows the following error:

HTTP Status 404 - /pages/index.xhtml Not Found in ExternalContext as a Resource

My directory structure:

-src

--main

---webapp

----WEB-INF

-----pages

------index.xhtml

My web.xml

     <!-- Spring Context Configuration' s Path definition -->
      <context-param>
      <param-name>contextConfigLocation</param-name>
      <param-value>
      /WEB-INF/config/applicationContext.xml
      </param-value>
   </context-param>
    <!-- Add Support for Spring -->
    <listener>
        <listener-class>    org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>
    <listener>
        <listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
    </listener>

    <context-param>
        <param-name>javax.faces.PROJECT_STAGE</param-name>
        <param-value>Development</param-value>
    </context-param>

    <!-- Welcome page -->
    <welcome-file-list>
        <welcome-file>pages/index.xhtml</welcome-file>
    </welcome-file-list>

    <!-- JSF Mapping -->
    <servlet>
        <servlet-name>Faces Servlet</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>/faces/*</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>*.xhtml</url-pattern>
    </servlet-mapping>

Thank you :)

cengiz
  • 101
  • 1
  • 7

1 Answers1

3

Put the pages folder in the webapp folder