title: 404 Error jsf application
body: <p>I am new to JSF, and I am making a simple jsf application.  I am getting a 404 Error when I try to run the application on using Tomcat, and I'm not sure why.  I tried running the application from eclipse and not from eclipse and neither works.  I've tried multiple different urls (all case sensitive), including localhost:8080/testing/faces/index.jsp, localhost:8080/testing/index.jsp, and localhost:8080/testing/, and none of them work.  As far as I can tell, my files are all in the correct place (my jsp files are under WebContent, my web.xml and my faces-config are in WEB-INF).  Does anyone have any idea what is wrong with my code?  I have pasted my web.xml and my faces-config below.</p>
  
  <p>web.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
  xmlns="http://java.sun.com/xml/ns/javaee" 
  xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" 
  xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
  http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0"&gt;
  &lt;display-name&gt;testing&lt;/display-name&gt;
    &lt;servlet&gt;
      &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
      &lt;servlet-class&gt;javax.faces.webapp.FacesServlet&lt;/servlet-class&gt;
      &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
    &lt;/servlet&gt;
    &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/faces/*&lt;/url-pattern&gt;
    &lt;/servlet-mapping&gt;
    &lt;context-param&gt;
      &lt;param-name&gt;javax.servlet.jsp.jstl.fmt.localizationContext&lt;/param-name&gt;
      &lt;param-value&gt;resources.application&lt;/param-value&gt;
    &lt;/context-param&gt;
    &lt;context-param&gt;
      &lt;description&gt;State saving method: 'client' or 'server' (=default). See JSF
                   Specification 2.5.2&lt;/description&gt;
      &lt;param-name&gt;javax.faces.STATE_SAVING_METHOD&lt;/param-name&gt;
      &lt;param-value&gt;client&lt;/param-value&gt;
    &lt;/context-param&gt;
    &lt;context-param&gt;
      &lt;description&gt;
  This parameter tells MyFaces if javascript code should be allowed in
  the rendered HTML output.
  If javascript is allowed, command_link anchors will have javascript code
  that submits the corresponding form.
  If javascript is not allowed, the state saving info and nested parameters
  will be added as url parameters.
  Default is 'true'&lt;/description&gt;
    &lt;param-name&gt;org.apache.myfaces.ALLOW_JAVASCRIPT&lt;/param-name&gt;
    &lt;param-value&gt;true&lt;/param-value&gt;
  &lt;/context-param&gt;
  &lt;context-param&gt;
    &lt;description&gt;
      If true, rendered HTML code will be formatted, so that it is 'human-readable'
          i.e. additional line separators and whitespace will be written, that do not
          influence the HTML code.
          Default is 'true'
    &lt;/description&gt;
    &lt;param-name&gt;org.apache.myfaces.PRETTY_HTML&lt;/param-name&gt;
    &lt;param-value&gt;true&lt;/param-value&gt;
  &lt;/context-param&gt;
  &lt;context-param&gt;
    &lt;param-name&gt;org.apache.myfaces.DETECT_JAVASCRIPT&lt;/param-name&gt;
    &lt;param-value&gt;false&lt;/param-value&gt;
  &lt;/context-param&gt;
  &lt;context-param&gt;
    &lt;description&gt;
  If true, a javascript function will be rendered that is able to restore the
  former vertical scroll on every request. Convenient feature if you have pages
  with long lists and you do not want the browser page to always jump to the top
  if you trigger a link or button action that stays on the same page.
  Default is 'false'
  
    &lt;/description&gt;
    &lt;param-name&gt;org.apache.myfaces.AUTO_SCROLL&lt;/param-name&gt;
    &lt;param-value&gt;true&lt;/param-value&gt;
  &lt;/context-param&gt;
  &lt;context-param&gt;
    &lt;param-name&gt;javax.faces.PROJECT_STAGE&lt;/param-name&gt;
    &lt;param-value&gt;Development&lt;/param-value&gt;
  &lt;/context-param&gt;
  
  &lt;listener&gt;
    &lt;listener-class&gt;org.apache.myfaces.webapp.StartupServletContextListener&lt;/listener-class&gt;
  &lt;/listener&gt;
  
  &lt;welcome-file-list&gt;
      &lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt;
    &lt;welcome-file&gt;faces/index.jsp&lt;/welcome-file&gt;
    &lt;welcome-file&gt;/index.jsp&lt;/welcome-file&gt;
  &lt;/welcome-file-list&gt;
  
  &lt;/web-app&gt;
  </code></pre>
  
  <p>faces-config.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  
  &lt;faces-config
      xmlns="http://java.sun.com/xml/ns/javaee"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://java.sun.com/xml/ns/javaee     
  http://java.sun.com/xml/ns/javaee/web-facesconfig_2_1.xsd"
      version="2.1"&gt;
       &lt;managed-bean&gt;
      &lt;managed-bean-name&gt;results&lt;/managed-bean-name&gt;
      &lt;managed-bean-class&gt;testing.model.Results&lt;/managed-bean-class&gt;
      &lt;managed-bean-scope&gt;session&lt;/managed-bean-scope&gt;
  &lt;/managed-bean&gt;
  &lt;managed-bean&gt;
      &lt;managed-bean-name&gt;tuple&lt;/managed-bean-name&gt;
      &lt;managed-bean-class&gt;testing.model.Tuple&lt;/managed-bean-class&gt;
      &lt;managed-bean-scope&gt;session&lt;/managed-bean-scope&gt;
  &lt;/managed-bean&gt;
  &lt;navigation-rule&gt;
      &lt;display-name&gt;WEB-INF/index&lt;/display-name&gt;
      &lt;from-view-id&gt;/WEB-INF/index.jsp&lt;/from-view-id&gt;
      &lt;navigation-case&gt;
          &lt;from-outcome&gt;true&lt;/from-outcome&gt;
          &lt;to-view-id&gt;/WEB-INF/newValsIndex.jsp&lt;/to-view-id&gt;
      &lt;/navigation-case&gt;
  &lt;/navigation-rule&gt;
  &lt;navigation-rule&gt;
      &lt;display-name&gt;WEB-INF/index&lt;/display-name&gt;
      &lt;from-view-id&gt;/WEB-INF/index.jsp&lt;/from-view-id&gt;
      &lt;navigation-case&gt;
          &lt;from-outcome&gt;false&lt;/from-outcome&gt;
          &lt;to-view-id&gt;/WEB-INF/failedLogin.jsp&lt;/to-view-id&gt;
      &lt;/navigation-case&gt;
  &lt;/navigation-rule&gt;
  
  &lt;/faces-config&gt;
  </code></pre>
  
  <p>Thank you very much!</p>