title: Tomcat doesn't see my servlet
body: <p>I'm working on ubuntu server 14.04 with tomcat 7 and jdk 8.
  I'm new to java servlets. So I red this tutorial <a href="http://www.tutorialspoint.com/servlets/servlets-first-example.htm" rel="nofollow">http://www.tutorialspoint.com/servlets/servlets-first-example.htm</a>, and did the same (but not in ROOT - in TESTAPP), but when I try <a href="http://localhost:8080/TESTAPP/HelloWorld" rel="nofollow">http://localhost:8080/TESTAPP/HelloWorld</a> i get 404 error.
  Directory hierarchy:</p>
  
  <pre><code>/var/lib/tomcat7/webapps/TESTAPP/
  |
  -- index.html
  -- META_INF/
  -- WEB_INF/
     |
  ----- web.xml
  ----- classes/
        |
  -------- HelloWorld.java
  -------- HelloWorld.class
  </code></pre>
  
  <p>index.html:</p>
  
  <pre><code>&lt;h1&gt;TESTAPP&lt;/h1&gt;
  </code></pre>
  
  <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" 
      xsi:schemaLocation="http://java.sun.com/xml/ns/javaee   http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" 
      id="TESTAPP" 
      version="3.0"&gt;
      &lt;servlet&gt;
          &lt;servlet-name&gt;HelloWorld&lt;/servlet-name&gt;
          &lt;servlet-class&gt;HelloWorld&lt;/servlet-class&gt;
      &lt;/servlet&gt;
  
     &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;HelloWorld&lt;/servlet-name&gt;
          &lt;url-pattern&gt;/HelloWorld&lt;/url-pattern&gt;
     &lt;/servlet-mapping&gt;
  &lt;/web-app&gt;
  </code></pre>
  
  <p>HelloWorld.java:</p>
  
  <pre><code>// Import required java libraries
  import java.io.*;
  import javax.servlet.*;
  import javax.servlet.http.*;
  
  // Extend HttpServlet class
  public class HelloWorld extends HttpServlet {
  
    private String message;
  
    public void init() throws ServletException
    {
        // Do required initialization
        message = "Hello World";
    }
  
    public void doGet(HttpServletRequest request,
                      HttpServletResponse response)
              throws ServletException, IOException
    {
        // Set response content type
        response.setContentType("text/html");
  
        // Actual logic goes here.
        PrintWriter out = response.getWriter();
        out.println("&lt;h1&gt;" + message + "&lt;/h1&gt;");
    }
  
    public void destroy()
    {
        // do nothing.
    }
  }
  </code></pre>
  
  <p>then i did</p>
  
  <pre><code>export CLASSPATH=/usr/share/tomcat7/lib/servlet-api.jar
  javac HelloWorld.java
  sudo service tomcat7 restart
  </code></pre>
  
  <p>catalina.out: <a href="http://pastebin.com/raw.php?i=5SM3vatg" rel="nofollow">http://pastebin.com/raw.php?i=5SM3vatg</a></p>
  
  <p>so then in browseer (or with curl)
  for <a href="http://localhost:8080/TESTAPP" rel="nofollow">http://localhost:8080/TESTAPP</a> i get OK
  for <a href="http://localhost:8080/TESTAPP/HelloWorld" rel="nofollow">http://localhost:8080/TESTAPP/HelloWorld</a> i get NOT FOUND.</p>
  
  <hr>
  
  <p>So where is my mistake?
  Please help.</p>