title: Getting HTTP Status 400 error while running a Servlet class using Tomcat server
body: <p>I am totally new to writing servlets.  I have created a simple HelloWorld program, but while running the application I'm getting the following error:</p>
  <blockquote>
  <p>HTTP Status 404 - /HelloWorld/HelloWorld</p>
  <p>type Status report</p>
  <p>message /HelloWorld/HelloWorld</p>
  <p>description: The requested resource is not available.</p>
  </blockquote>
  <p>Below is my code:</p>
  <pre><code>import java.io.IOException;
  import java.io.PrintWriter;
  
  import javax.servlet.ServletException;
  import javax.servlet.annotation.WebServlet;
  import javax.servlet.http.HttpServlet;
  import javax.servlet.http.HttpServletRequest;
  import javax.servlet.http.HttpServletResponse;
  
  
  @WebServlet(&quot;/HelloWorld&quot;)
  public class HelloWorld extends HttpServlet {
      private static final long serialVersionUID = 1L;           
      
      public HelloWorld() {
          super();  
      }    
      
      protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
          PrintWriter out=response.getWriter();
          out.println(&quot;Hello World&quot;);
      }
  }
  </code></pre>
  <p>And my web.xml</p>
  <pre><code>&lt;display-name&gt;HelloWorld&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>I'm using Tomcat version:7.0 and my IDE is Eclipse Luna.  Why is this error being thrown?</p>