title: HTTP Status 404 - /FirstServlet/test
body: <p>I am trying to do work in simple servlet example using notepad but it's showing an error like this:</p>
  
  <pre><code>HTTP Status 404 - /FirstServlet/test
  type Status report
  message /FirstServlet/test
  description The requested resource is not available.
  Apache Tomcat/7.0.47
  </code></pre>
  
  <p>i'm running this into eclipse still showing the same error:</p>
  
  <p><img src="https://s16.postimg.org/xpun3bsyd/Screenshot.jpg" alt="here"></p>
  
  <p>Is that a window's problem ? I'm using windows 8.</p>
  
  <p>Tell me to fix the error,here is my classpath which i set in Environment variables options:</p>
  
  <pre><code>Classpath: D:\apache-tomcat-7.0.47\lib\servlet-api.jar
  java_home: C:\Program Files\Java\jdk1.7.0_25
  path: C:\Program Files\Java\jdk1.7.0_25\bin
  </code></pre>
  
  <p>My code for TestServlet.java follows: </p>
  
  <pre><code>import java.io.IOException;
  import java.io.PrintWriter;
  import javax.servlet.http.HttpServlet;
  import javax.servlet.http.HttpServletRequest;
  import javax.servlet.http.HttpServletResponse;
  
  public class TestServlet extends HttpServlet{
  
      public void doGet(HttpServletRequest request, HttpServletResponse response)
      throws IOException{
          PrintWriter out = response.getWriter();
          out.println("&lt;html&gt;");
          out.println("&lt;body&gt;");
          out.println("&lt;h1&gt;Hello Servlet Get&lt;/h1&gt;");
          out.println("&lt;/body&gt;");
          out.println("&lt;/html&gt;"); 
      }
  }
  </code></pre>
  
  <p>and here is my source code for 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_2_5.xsd" id="WebApp_ID" version="2.5"&gt;
        &lt;display-name&gt;MyWebApp&lt;/display-name&gt;
        &lt;servlet&gt;
          &lt;description&gt;&lt;/description&gt;
          &lt;display-name&gt;TestServlet&lt;/display-name&gt;
          &lt;servlet-name&gt;TestServlet&lt;/servlet-name&gt;
          &lt;servlet-class&gt;bla.TestServlet&lt;/servlet-class&gt;
        &lt;/servlet&gt;
        &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;TestServlet&lt;/servlet-name&gt;
          &lt;url-pattern&gt;/test&lt;/url-pattern&gt;
        &lt;/servlet-mapping&gt;
      &lt;/web-app&gt;
  </code></pre>
  
  <p>and here is a structure of my folder where i saved my file as:</p>
  
  <pre><code>apache-tomcat-7.0.47
  |
  |
  Webapps(folder)
  |
  |
  |    (project name)
  |==FirstServlet==&gt;&gt;WEB-INF
                        |
                        |
                        |==classes(folder)==&gt;&gt;bla(folder)==&gt;&gt;TestServlet.class(compiled file) and TestServlet.java(source code for servlet)
                        |
                        |==lib(folder)==&gt;&gt;servlet-api.jar (api of servlet where i copied)
                        |
                        |==web.xml (xml file)
  </code></pre>
  
  <p>My url: </p>
  
  <p>i'm accessing the url like this <code>http://localhost:8080/FirstServlet/test</code></p>
  
  <p>here is an image which showing an error:</p>
  
  <p><a href="https://i.stack.imgur.com/HMr93.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HMr93.jpg" alt="enter image description here"></a></p>