title: Change default homepage in root path to servlet with doGet
body: <p>I have a small maven (indirectly through Netbeans 8.1 &amp; tomcat setup) </p>
  
  <p>And whenever I ran the project it opens the browser with a HelloWord on the root:</p>
  
  <p>i.e the page on <code>http://localhost:8084/</code> is:</p>
  
  <p></p>
  
  <pre><code>&lt;html&gt;
      &lt;head&gt;
          &lt;title&gt;Start Page&lt;/title&gt;
          &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;h1&gt;Hello World!&lt;/h1&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I've tried to create a servlet to replace it using:</p>
  
  <p><code>@WebServlet(name = "HomeServlet", urlPatterns = {"/"})</code> however, it did not work as expected. </p>
  
  <p>I.e. it still showed the same hello world on: <code>http://localhost:8084</code></p>
  
  <p>But it did mess with all the files on the root i.e <code>http://localhost:8084/foo.css</code> was being handled by this servlet as well and getting its response. </p>
  
  <p>So, my question is (actually two): </p>
  
  <p><strong>How can I change the contents of this page to something else ?</strong></p>
  
  <p>Or, at the very least (if the former is impossible): <strong>Can I use a permanent redirect on root path to avoid the user from seeing this page?</strong> </p>
  
  <p>(i.e. http code 301) to move the user to <code>http://localhost:8084/home</code></p>