title: running and deploying servlet with eclipse and tomcat 7
body: <ol>
  <li>I created a test project based on <a href="http://www.idimmu.net/2009/03/11/tomcat-helloworld-servlet-with-eclipse/" rel="nofollow noreferrer">Tomcat HelloWorld Servlet with Eclipse</a></li>
  <li>and tried to run it from Eclipse as is with Tomcat 7, which I have configured to run on 127.0.0.1 - but I get <code>Page cannot be found</code> at 127.0.0.1/helloworld/HelloWorld</li>
  <li>I also tried exporting as war file and deploying it to the (otherwise working) Tomcat server running as a Windows service - and deployed with the Tomcat Application Manager - manifest.mf and the classes are nicely copied to tomcat/webapps/helloworld, but trying to navigate to 127.0.0.1/helloworld/HelloWorld fails again, showing <code>HTTP Status 404</code></li>
  </ol>
  <h3>From default @WebServlet to web.xml configuration</h3>
  <p>Next, in HelloWorld.java, I tried commenting out</p>
  <pre><code>//@WebServlet(&quot;/HelloWorld&quot;)
  </code></pre>
  <p>and then adding a web-application-specific web.xml configuration:</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  &lt;web-app xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
      xmlns=&quot;http://java.sun.com/xml/ns/javaee&quot;
      xsi:schemaLocation=&quot;http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd&quot;
      version=&quot;3.0&quot;&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>But the results are still the same - no response!</p>
  <h3>Solutions?</h3>
  <ul>
  <li>Given the linked tutorial provides instructions for Tomcat 6, should I change something to make it work with Tomcat 7?</li>
  <li>Specifically, is the default <code>@WebServlet(&quot;/HelloWorld&quot;)</code> added by Eclipse sufficient? What is needed for the annotation-based configuration of Servlet 3.0 to work (without web.xml)?</li>
  <li>Or could it be that something is blocking any web app deployment at the global tomcat server level? I have changed the server configuration somewhat, and unfortunately i do not remember exactly what, except for making it serve on 127.0.0.1 rather than 127.0.0.1:8080</li>
  </ul>