tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hans Bergsten <h...@gefionsoftware.com>
Subject Re: Relative Paths
Date Sat, 13 May 2000 18:36:39 GMT
Andrew Worsley wrote:
> 
>    My understanding is that when you map a URL prefix to a particular servlet
>    then *ALL* URLs starting with that prefix go to that servlet. That is as
>    defined in the servlet API 2.2 section 5.4 pages 28-29.
> 
>    i.e. A servlet mapping / would map *ALL* URLs to that servlet.
> 
>         Andrew
> 
> > I've got some more information that may help. It seems that my problem with
> > relative paths revolves around the fact that my context (site) is servlet
> > driven. In fact, I specify in my web.xml file that my servlet is mapped to
> > "/". Unfortunately, this has the unwanted side-effect of routing all
> > requests for images, resources, etc. through my servlet.
> >
> > 1. Is this expected behavior? Surely, it is very common to distribute a war
> > file with a servlet mapped to "/".
> >
> > 2. What's the best way to work around this situation?

The "/" mapping is a bit special; it's the mapping for the default servlet,
in other words, the servlet that handles all URIs that don't match something
more specific. So if you want images and other special files handled by the
standard Tomcat default servlet, add extension mappings for *.jpg, *.gif,
etc. as well.

Hans
-- 
Hans Bergsten		hans@gefionsoftware.com
Gefion Software		http://www.gefionsoftware.com

Mime
View raw message