title: My servlet is not being called, what am I doing wrong?
body: <p>I am new to Java, and especially new to using sevlets. I am making a VERY simple servlet, but whenever I submit the form the servlet is not being called and I am getting an error. Can someone help me please?</p>
  
  <p>Here is my servlet code: </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 sampleServlet 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;"); 
      }
  }
  
  
  &lt;form action="/sampleServlet/" method="GET"&gt;
    &lt;input type="submit" value="Submit form "/&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>The error that I am getting is: "The requested resource is not available."</p>
  
  <p>My 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://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;Projekt&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>