title: How to stop Tomcat from redirecting root URL path and adding a slash?
body: <p>I created a Java web application and deployed the WAR (<code>myapp.war</code>) to Tomcat. When I hit the URL:</p>
  
  <p><code>http://server.com/myapp</code></p>
  
  <p>Tomcat redirects the browser to:</p>
  
  <p><code>http://server.com/myapp/</code></p>
  
  <p>How do I stop that? I don't want it to add the slash. I want my servlet to handle the request at <code>/myapp</code>. </p>
  
  <p>My servlet mapping in <code>web.xml</code> looks like:</p>
  
  <pre><code>&lt;servlet-mapping&gt;
      &lt;servlet-name&gt;PageServlet&lt;/servlet-name&gt;
      &lt;url-pattern&gt;&lt;/url-pattern&gt;  
      &lt;url-pattern&gt;/other&lt;/url-pattern&gt;
      ...
  </code></pre>
  
  <p>I thought the empty pattern would get the root URL (<code>/myapp</code>) and let me handle it myself.</p>