title: HttpServlet mapping doesn't work
body: <p>I'm using Apache Tomcat v8.0 server and in Java EE application. Basically, I created an ResponseUpload servlet. I need to get JSON data from the web app through POST request. Here it is the code of the Servlet:</p>
  
  <pre><code>@WebServlet("/RequestUpload")
  public class RequestUpload extends HttpServlet {
  private static final long serialVersionUID = 1L;
  
  /**
   * @see HttpServlet#HttpServlet()
   */
  public RequestUpload() {
      super();
      // TODO Auto-generated constructor stub
  }
  /**
   * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
   */
  protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
      // TODO Auto-generated method stub
      BufferedReader reader = request.getReader();
      Gson gson = new Gson();
      JSONObject json = gson.fromJson(reader, JSONObject.class);
      uplRequest.upload(json);
  
      PrintWriter out = response.getWriter();
      out.print(json);
  }
  </code></pre>
  
  <p>Then to test if it works I added a form to jsp file, doing <b>POST</b> to url:</p>
  
  <blockquote>
    <p><a href="http://localhost:8080/webApp/RequestUpload" rel="nofollow">http://localhost:8080/webApp/RequestUpload</a></p>
  </blockquote>
  
  <p>The form:</p>
  
  <pre><code>&lt;form action= "RequestUpload" method = "POST"&gt;
      First Name: &lt;input type = "text" name = "first_name"&gt;
      &lt;br /&gt;
      Last Name: &lt;input type = "text" name = "last_name" /&gt;
      &lt;input type = "submit" value = "Submit" /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>But I got 404 error - </p>
  
  <blockquote>
    <p>HTTP Status 404 - /webApp/RequestUpload</p>
  </blockquote>
  
  <p>Can somebody show me where is my mistake?</p>
  
  <p>My web.xml file:</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://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" id="WebApp_ID" version="3.1"&gt;
    &lt;display-name&gt;webApp&lt;/display-name&gt;
    &lt;welcome-file-list&gt;
      &lt;welcome-file&gt;index.html&lt;/welcome-file&gt;
      &lt;welcome-file&gt;index.htm&lt;/welcome-file&gt;
      &lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt;
      &lt;welcome-file&gt;default.html&lt;/welcome-file&gt;
      &lt;welcome-file&gt;default.htm&lt;/welcome-file&gt;
      &lt;welcome-file&gt;default.jsp&lt;/welcome-file&gt;
    &lt;/welcome-file-list&gt;
  
  &lt;/web-app&gt;
  </code></pre>
  
  <p>P.S. Another form doing the same with RPC servlet (which structure is similar) is working.</p>