tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <Craig.McClana...@eng.sun.com>
Subject Re: url-pattern behaviour
Date Wed, 13 Dec 2000 02:32:40 GMT
Jose Oliver wrote:

>         Hello,
>
>         I'm trying to configure tomcat with some
> servlets, and I've found a difference in
> behaviour from other servlet engines. I'm trying
> to configure it in such a way that requests for
> the main page (http://www.blah.blah.com/) are
> served by a servlet called StartServlet:
>
>   <servlet-mapping>
>     <servlet-name>StartServlet</servlet-name>
>     <url-pattern>/</url-pattern>
>   </servlet-mapping>
>
> and it actually does it, but the problem is that
> it serves _any_ url that starts with "/", for
> example "/images/whateverfooimage.jpg". The
> same application running under Dynamo 5.0 does
> it ok (for me), since StartServlet only serves
> request for "/" url...
>
>         Is this a bug in tomcat? Or is a
> "feature" of Dynamo?
>

Which version of Tomcat?

The "/" mapping is defined in the servlet spec as "use this servlet only if none
of the other mappings match."  So, if you have JSP pages mapped to the JSP
servlet (in the usual way), the JSP mapping should be used first.

You might also experiment with declaring your servlet as the "welcome file" for
this app.  See the servlet spec
<http://java.sun.com/products/servlet/download.html> for more details.

>
>         Best,
>         Jose

Craig



Mime
View raw message