title: Can anyone explain servlet mapping?
body: <p>I'm trying to write a web application using SpringMVC. Normally I'd just map some made-up file extension to Spring's front controller and live happily, but this time I'm going for REST-like URLs, with no file-name extensions.</p>
  
  <p>Mapping everything under my context path to the front controller (let's call it "<strong>app</strong>") means I should take care of static files also, something I'd rather not do (why reinvent yet another weel?), so some combination with tomcat's default servlet (let's call it "<strong>tomcat</strong>") appears to be the way to go.</p>
  
  <p>I got the thing to work doing something like </p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;servlet-mapping&gt;
    &lt;servlet-name&gt;app&lt;/servlet-name&gt;
    &lt;url-pattern&gt;/&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  
  &lt;servlet-mapping&gt;
    &lt;servlet-name&gt;tomcat&lt;/servlet-name&gt;
    &lt;url-pattern&gt;*.ext&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  </code></pre>
  
  <p>and repeating the latter for each one of the file extensions of my static content. I'm just wondering why the following setups, which to me are equivalent to the one above, don't work.</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;!-- failed attempt #1 --&gt;
  &lt;servlet-mapping&gt;
    &lt;servlet-name&gt;app&lt;/servlet-name&gt;
    &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  
  &lt;servlet-mapping&gt;
    &lt;servlet-name&gt;tomcat&lt;/servlet-name&gt;
    &lt;url-pattern&gt;*.ext&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  
  &lt;!-- failed attempt #2 --&gt;
  &lt;servlet-mapping&gt;
    &lt;servlet-name&gt;app&lt;/servlet-name&gt;
    &lt;url-pattern&gt;/&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  
  &lt;servlet-mapping&gt;
    &lt;servlet-name&gt;tomcat&lt;/servlet-name&gt;
    &lt;url-pattern&gt;/some-static-content-folder/*&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  </code></pre>
  
  <p>Can anyone shed some light?</p>