tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Schmitt, Christian" <Christian.Schm...@Dresdner-Bank.com>
Subject AW: Servlet mapping
Date Mon, 14 Aug 2000 13:05:57 GMT
Craig,
yes, I tried that and that's working as well. But I probably didn't make
myself very clear.
What I want to achieve is that the servlet is found and called regardless of
the URL i.e.:
http://localhost/cs/some/directory/info  --> OK that works with the mapping
below.
But what if I also want to find the servlet here:
http://localhost/cs/a/totally/different/directory/info
OK, now I could map the servlet to this directory as well, but I don't want
to :-)

I read the Java Servlet Specificiation and in chapter 10.1 (page 47) it
says:
1. The servlet container will try to match the exact path of the request to
a servlet.
2. The container will then try to recursively match the longest path prefix
mapping.

I thought that this means that if I map a servlet like this:
<servlet-mapping>
  <servlet-name>info</servlet-name>
  <url-pattern>/info/*</url-pattern>
</servlet-mapping>

the servlet should be called whenever the container finds 'info/*' in the
request.

Puzzled,
Christian

>
>
>How about the following (assuming that "/cs" is your context path):
>    <servlet-mapping>
>        <servlet-name>info</servlet-name>
>
>        <url-pattern>/some/directory/info/*</url-pattern>
>    </servlet-mapping>

>Craig


Mime
View raw message