tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shapira, Yoav" <Yoav.Shap...@mpi.com>
Subject RE: The same servlet through 2 different URL
Date Fri, 01 Aug 2003 15:12:09 GMT

Howdy,
You can have two <servlet-mapping> tags for your servlet.

As an aside, IMHO Principal is not that good a name for a servlet as one
might confuse it with java.security.Principal.

Yoav Shapira
Millennium ChemInformatics


>-----Original Message-----
>From: Moraes, Fabio [mailto:fabio.moraes@eds.com]
>Sent: Friday, August 01, 2003 10:53 AM
>To: Tomcat Users
>Subject: The same servlet through 2 different URL
>Importance: High
>
>
>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
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org




This e-mail, including any attachments, is a confidential business communication, and may
contain information that is confidential, proprietary and/or privileged.  This e-mail is intended
only for the individual(s) to whom it is addressed, and may not be saved, copied, printed,
disclosed or used by anyone else.  If you are not the(an) intended recipient, please immediately
delete this e-mail from your computer system and notify the sender.  Thank you.


Mime
View raw message