tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Smith <d...@cornell.edu>
Subject Re: Default servlet url mapping issue
Date Wed, 20 May 2009 13:46:18 GMT
I don't see that either and I've read it a couple of times.  Seems like
this is just a limitation of the default servlet.

--David

Serge Fonville wrote:
> Just out of interest, but where, how and why does it violate the spec?
>
> On Wed, May 20, 2009 at 3:33 PM, Mark Thomas <markt@apache.org> wrote:
>   
>> Viktoras Agejevas wrote:
>>     
>>> Hi,
>>>
>>> I have a weird default servlet url mapping issue
>>> (Tomcat 6.0.18 with fully default configuration).
>>>
>>> Here's my web.xml configuration:
>>>
>>> <web-app ... v2.5>
>>> <servlet-mapping>
>>>       <servlet-name>AnyServlet</servlet-name>
>>>       <url-pattern>/*</url-pattern>
>>> </servlet-mapping>
>>> <servlet-mapping>
>>>       <servlet-name>default</servlet-name>
>>>       <url-pattern>/resources/css/*</url-pattern>
>>> </servlet-mapping>
>>> </web-app>
>>>
>>> 1. If I request http://localhost:8080/whatever
>>>    AnyServlet handles the request. - OK
>>> 2. If I request http://localhost:8080/resources/css/style.css
>>>    I get a Tomcat 404 error page. - NOT OK
>>> 3. If I request http://localhost:8080/resources/resources/css/style.css
>>>    I get the style.css file. - NOT OK
>>>
>>> Directory layout is:
>>>
>>> webapps
>>>   |--ROOT
>>>   |       |--resources
>>>   |       |       |--css
>>>   |       |            |--style.css
>>>   |       |--WEB-INF
>>>   |       |       |--web.xml
>>>
>>> If I run the same example in Jetty everything works as expected.
>>>
>>> I don't know if it's a bug in Tomcat or some Tomcat misconfiguration
>>> but it clearly violates Servlet specification...
>>> Any ideas about the issue?
>>>       
>> You can't map the default servlet to anything other than /*. It isn't
>> designed to work in the manner you are using it.
>>
>> Mark
>>
>>     


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message