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 Servlet mapping
Date Mon, 14 Aug 2000 08:37:31 GMT
Hi all,
I have a question concerning mapping of servlets.
Consider the following excerpt from server.xml:

<Context 
  path="/cs/maptest" 
  docBase="/home/cs/maptest"
  debug="1"
  reloadable="true" >
</Context>

Now I have the following on my web.xml:
<web-app>
  <servlet>
    <servlet-name>info</servlet-info>
    <servlet-class>Info</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>info</servlet-name>
    <url-pattern>info/*</url-pattern>
  </servlet-mapping>
</web-app>

Now when I point my browser to http://localhost/cs/servlet/info the servlet
is found and executes as expected. But what I really want to do is for
example: http://localhost/cs/some/directory/info but Tomcat does not find
the servlet and returns a 404 error. When I change the servlet mapping in
web.xml to:
  <servlet-mapping>
    <servlet-name>info</servlet-name>
    <url-pattern>/info/*</url-pattern>
  </servlet-mapping>

Now Tomcat finds the servlet under http://localhost/cs/servlet/info as well
as http://localhost/cs/info but not under any other paths.

Am I missing something here or is it not possible?

Thanks for any tips.

Christian Schmitt

Mime
View raw message