Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I think I may know what is going on.</p> <p>In your working web.xml you have set your servlet to be the default servlet (/ by itself is the default servlet called if there are no other matches), it will answer any request that doesn't match another mapping.</p> <p>In Failed 1 your /* mapping does appear to be a valid path mapping. With the /* mapping in web.xml it answers all requests except other path mappings. According to the specification extension mappings are implicit mappings that are overwritten by explicit mappings. That's why the extension mapping failed. Everything was explicitly mapped to app.</p> <p>In Failed 2, App is responsible for everything, except content that matches the static content mapping. To show what is happening in the quick test I set up. Here is an example. <code>/some-static-content-folder/</code> contains <code>test.png</code></p> <p>Trying to access test.png I tried:</p> <pre><code>/some-static-content-folder/test.png </code></pre> <p>and the file was not found. However trying</p> <pre><code>/some-static-content-folder/some-static-content-folder/test.png </code></pre> <p>it comes up. So it seems that the Tomcat default servlet (6.0.16 at least) drops the servlet mapping and will try to find the file by using the remaining path. According to this post <a href="https://stackoverflow.com/questions/132052">Servlet for serving static content</a> Jetty gives the behavior you and I were expecting.</p> <p>Is there some reason you can't do something like map a root directory for your rest calls. Something like app mapped to /rest_root/* than you are responsible for anything that goes on in the rest_root folder, but anywhere else should be handled by Tomcat, unless you make another explicit mapping. I suggest setting your rest servlet to a path mapping, because it declares the intent better. Using / or /* don't seem appropriate, since you have to map out the exceptions. Using SO as an example, my rest mappings would be something like</p> <blockquote> <p>/users/* for the user servlet</p> <p>/posts/* for the posts servlet</p> </blockquote> <p>Mapping order</p> <ol> <li>Explicit (Path mappings)</li> <li>Implicit (Extension mappings)</li> <li>Default (/)</li> </ol> <p>Please correct anything that I got wrong.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload