Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

With the following configuration:


then both Tomcat7 and Tomcat6 serves the following URL just fine:

However, if I reduce the configuration to just mention the CSS pattern:


Then Tomcat6 works, but Tomcat7 fails with: The requested resource () is not available.

Why is there a difference here?

share|improve this question

migrated from stackoverflow.com May 10 '12 at 9:53

This question came from our site for professional and enthusiast programmers.

Because they decided to change it? – Brian Roach May 9 '12 at 1:32
If I do not add any “default” 。Access Success。 tomcat7 ,tomcat6 – weisd May 9 '12 at 2:04
up vote 2 down vote accepted

You should not map container's default servlet in your webapp's web.xml. Whatever functional requirement for which you thought that this is the solution, it has definitely to be solved differently.

If you have for example overridden it with a custom front controller servlet on an URL pattern of /, then you should fix that servlet to listen on a more specific URL pattern instead. Use if necessary a filter to "hide" the servlet's specific URL pattern by collecting all static resources in a single folder such as /static or /resources and letting the filter check on that.

See also:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.