tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Moraes, Fabio" <fabio.mor...@eds.com>
Subject The same servlet through 2 different URL
Date Fri, 01 Aug 2003 14:52:40 GMT

SCENE: I'm using Tomcat 4.1.

I want my servlet Principal.class to be called when someone access
http://localhost/projname/ OR http://localhost/projname/index

I put this in webapps/projname/web.xml:

   <servlet>
       <servlet-name>Principal</servlet-name>
       <servlet-class>servlets.Principal</servlet-class>
   </servlet>

and this:

   <servlet-mapping>
      <servlet-name>Principal</servlet-name>
      <url-pattern>/</url-pattern>
   </servlet-mapping>

Everything works for http://localhost/projname/, but not for
http://localhost/projname/index.

Then, I tried:

   <servlet-mapping>
      <servlet-name>Principal</servlet-name>
      <url-pattern>/</url-pattern>
      <url-pattern>/index</url-pattern>
   </servlet-mapping>

Everything works for http://localhost/projname/index, but not for
http://localhost/projname/.

It seems the last URL-PATTERN tag overwrites the others ...

How could I make it work fine ?

Thanks,

---
 Fabio Moraes
 fabio.moraes@eds.com
 System Engineer
 Work Force Management System
 +55 21 3088 9548


Mime
View raw message