title: Lift webapp has directory and resource with the same name, but gives 302
body: <p>I deployed <code>example.war</code> to Tomcat 6.0.32 (latest at time of writing), and the deployed webapp contains the following:</p>
  
  <pre><code>$ find example | egrep -v "WEB-INF/lib|WEB-INF/classes"
  example
  example/_items.html
  example/_share_link.html
  example/all_items.html
  example/images
  example/images/ajax-loader.gif
  example/index.html
  example/item
  example/item/star.html
  example/item.html
  example/js
  example/js/c-jquery-1.4.2.js
  example/js/c-jquery-ui-1.8.2.js
  example/js/jquery-1.4.2.js
  example/js/jquery-1.4.4.min.js
  example/js/jquery-ui-1.8.2.js
  example/js/jquery-ui-1.8.8.custom.min.js
  example/js/jquery.blockUI.js
  example/META-INF
  example/META-INF/MANIFEST.MF
  example/search.html
  example/static
  example/static/index.html
  example/templates-hidden
  example/templates-hidden/default.html
  example/templates-hidden/wizard-all.html
  example/WEB-INF
  example/WEB-INF/web.xml
  </code></pre>
  
  <p>Particularly note:</p>
  
  <pre><code>example/item
  example/item/star.html
  example/item.html
  </code></pre>
  
  <p>I try and request the above resource:</p>
  
  <pre><code>$ telnet localhost 8080
  Trying ::1...
  Connected to localhost.
  Escape character is '^]'.
  GET /example/item HTTP/1.0
  
  HTTP/1.1 302 Moved Temporarily
  Server: Apache-Coyote/1.1
  Location: http://localhost:8080/example/item/
  Date: Thu, 07 Apr 2011 08:24:39 GMT
  Connection: close
  
  Connection closed by foreign host.
  </code></pre>
  
  <p>The server told me to try <code>/example/item/</code></p>
  
  <pre><code>$ telnet localhost 8080
  Trying ::1...
  Connected to localhost.
  Escape character is '^]'.
  GET /example/item/ HTTP/1.0
  
  HTTP/1.1 404 Not Found
  Server: Apache-Coyote/1.1
  Set-Cookie: JSESSIONID=6D97AD3A8F77697146163946B1BBBB64; Path=/example
  Expires: Thu, 7 Apr 2011 08:24:58 UTC
  Cache-Control: no-cache, private, no-store
  Pragma: no-cache
  Date: Thu, 07 Apr 2011 08:24:58 GMT
  X-Lift-Version: 2.3
  Content-Type: text/html;charset=utf-8
  Content-Length: 106
  Connection: close
  
  &lt;!DOCTYPE html&gt;
  &lt;html&gt; &lt;body&gt;The Requested URL /example/item/ was not found on this server&lt;/body&gt; &lt;/html&gt;  
    Connection closed by foreign host.
  </code></pre>
  
  <p>This is not what I expect. The first request to <code>/example/item</code> (without the trailing slash) should work -- at this point the Lift web framework takes over and renders my items, using <code>star.html</code> as a template. This works really well with Jetty 6.1.22 and Resin 4.0.16, but not Tomcat.</p>
  
  <p>Is there some special configuration I'm missing? Is there something in the servlet specification which denotes the correct behaviour in this case?</p>
  
  <p>The example code I used can be found here:
  <a href="https://github.com/dpp/simply_lift/tree/master/samples/shopwithme" rel="nofollow">https://github.com/dpp/simply_lift/tree/master/samples/shopwithme</a></p>
  
  <p>I raised the original issue here:
  <a href="https://groups.google.com/forum/?fromgroups#!topic/liftweb/7QlFud1ieOU" rel="nofollow">https://groups.google.com/forum/?fromgroups#!topic/liftweb/7QlFud1ieOU</a></p>
  
  <p><strong>Note</strong> This question is not about Lift or its rendering pipeline -- it's about Tomcat, and why its behaviour differs from Jetty and Resin's.</p>
  
  <hr/>
  
  <p><strong>UPDATE:</strong> This is the classic "trailing slash" issue, and a bug report has been filed here: <a href="https://issues.apache.org/bugzilla/show_bug.cgi?id=32424" rel="nofollow">https://issues.apache.org/bugzilla/show_bug.cgi?id=32424</a></p>