tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <craig...@apache.org>
Subject Re: The problem with "/"
Date Tue, 22 Jan 2002 17:39:25 GMT


On Tue, 22 Jan 2002, Peter Sojan wrote:

> Date: Tue, 22 Jan 2002 03:30:43 +0100
> From: Peter Sojan <ilikeunix@gmx.net>
> Reply-To: Tomcat Developers List <tomcat-dev@jakarta.apache.org>
> To: Tomcat Developers List <tomcat-dev@jakarta.apache.org>
> Subject: Re: The problem with "/"
>
>
> Thank you for your hint!
>
> Now I understand, that with my setting:
>
> ----------------------------------
> <servlet-mapping>
>     <servlet-name>MyMainServlet</servlet-name>
>     <url-pattern>/</url-pattern>
>  </servlet-mapping>
> ----------------------------------
>
> I override the default configuration which is:
>
> ----------------------------------
>  <servlet-mapping>
>     <servlet-name>default</servlet-name>
>     <url-pattern>/</url-pattern>
>   </servlet-mapping>
> ----------------------------------
>
> If I want to handle all requests for non-existent resources with
> my "MyMainServlet" and all static-existent (non-servlet) resources
> with "DefaultServlet", your solution should work If I can forsee
> every type of static resource I will offer in my webapp.
>
> So I would have to write mappings for *.gif, *.jpg, *.png, *.pdf,
> *.bla, and so on. I think the way the spec handles this issue, is
> that if I do a mapping on "/", then requests for static-existent
> content would still be served by the container without invoking
> my MyMainServlet. However since the tomcat solution is to handle
> static content with a DefaultServlet, I will always loose this
> functionality when I override the "/" mapping with my own servlet.
>
> Any suggestions for a workaround!?

How about just serving the content yourself?  It's not difficult to do.

> Thx
> Peter
>

Craig


--
To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>


Mime
View raw message