title: Tomcat not running servlet
body: <p>So I wrote a servlet that redirects all requests to /foo/* to an .jsf file saying the URL no longer exists. I got it setup so that I can navigate to /newpath/error.faces just find. The problem when I start the server in eclipse and navigate to any URL matching that /foo/* mapping I get nothing. No a 404 in the browser and jack squat in the console. No errors, no messages, nothing and I can figure out why.</p>
  
  <p>I checked to make sure I'm in the proper root by going to Window->Preferences->Server->Runtime Environment->Apache Tomcatv7.0->Edit-> and looked at the Tomcat Installation Directory Field.</p>
  
  <p>which points to C:/Users/myName/Tomcat 7.0.</p>
  
  <p>The web.xml file in C:/Users/myName/Tomcat 7.0/webapps/ROOT/WEB-INF looks like:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="ISO-8859-1"?&gt;
  &lt;!--
   Licensed to the Apache Software Foundation (ASF) under one or more
   contributor license agreements.  See the NOTICE file distributed with
   this work for additional information regarding copyright ownership.
   The ASF licenses this file to You under the Apache License, Version 2.0
   (the "License"); you may not use this file except in compliance with
   the License.  You may obtain a copy of the License at
  
    http://www.apache.org/licenses/LICENSE-2.0
  
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
    --&gt;
  
   &lt;web-app 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-app_3_0.xsd"
    version="3.0"
    metadata-complete="true"&gt;  
  
   &lt;display-name&gt;Welcome to Tomcat&lt;/display-name&gt;
   &lt;description&gt;
     Welcome to Tomcat
   &lt;/description&gt;
  
  &lt;servlet&gt;
    &lt;servlet-name&gt;errorServlet&lt;/servlet-name&gt;
    &lt;servlet-class&gt;errorServlet&lt;/servlet-class&gt;
  &lt;/servlet&gt;
  
    &lt;servlet-mapping&gt;
     &lt;servlet-name&gt;errorServlet&lt;/servlet-name&gt;
     &lt;url-pattern&gt;/foo/*&lt;/url-pattern&gt;
    &lt;/servlet-mapping&gt;
   &lt;/web-app&gt;
  &lt;/web-app&gt;
  </code></pre>
  
  <p>and errorServlet.java which is located in the same directory looks like</p>
  
  <pre><code>import java.io.*;
  import javax.servlet.ServletConfig;
  import javax.servlet.ServletException;
  import javax.servlet.http.HttpServlet;
  import javax.servlet.http.HttpServletRequest;
  import javax.servlet.http.HttpServletResponse;
  
  public class errorServlet extends HttpServlet{
  
  
  public errorServlet(){
      super();
  }
  
  public void init(ServletConfig config) throws ServletException{
      super.init(config);
  }
  
  
  public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException{
    processRequest(request, response);
  }
  
  protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException{
    String redirectString = response.encodeRedirectURL("/newpath/error.faces");
    response.sendRedirect(redirectString);
  }
  
  }
  </code></pre>
  
  <p>I have compiled the .class and .jar files from errorServlet.java (named errorServlet.class and errorServlet.jar respectively) and they're in the same locationas the .java file. What am I missing or doing wrong? Why is my servlet not firing when I got to /foo/*?</p>
  
  <p>Edit: I've made the changes suggested by the first two answers while their suggestions are appreciated I'm still seeing literally nothing (at this point I would kill to for at least an error message).</p>