Return-Path: Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 78376 invoked from network); 19 Sep 2000 22:10:25 -0000 Received: from unknown (HELO vdcrexc1.orange.ch) (212.215.1.70) by locus.apache.org with SMTP; 19 Sep 2000 22:10:25 -0000 Received: by vdcrexc1.orange.ch with Internet Mail Service (5.5.2650.21) id ; Tue, 19 Sep 2000 21:11:49 +0200 Message-ID: <2B26E094BB13D3118FB3006008214FA5F06F0F@vdlaexc0.orange.ch> From: Kitching Simon To: "'tomcat-user@jakarta.apache.org'" Subject: RE: confugure the URL pattern Date: Tue, 19 Sep 2000 21:11:42 +0200 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2650.21) Content-Type: text/plain X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N Hi > -----Original Message----- > From: Hongbin Xie [SMTP:hongbin@contact.com] > Sent: Tuesday, September 19, 2000 8:55 PM > To: tomcat-user@jakarta.apache.org > Subject: confugure the URL pattern > > Hello everyone, > > With the requirement from the client, we need to configure our servlet > url as the following: > http://localhost/name/name, in which, name is the alias for sevlet name, > right now, I just configure it to > http://localhost/name/servlet/name, I don't know how to get rid of the > /servlet in the middle, please give advice. Thanks for help. > > Hongbin [Kitching Simon] There is a little "convenience" feature that makes all your servlets automatically available via the "/webapp/servlet/{anyname}" url (that's what you're using at the moment to get your servlet run). What you need to do is set up definitions and mappings explicitly for each servlet in the webapp/WEB-INF/web.xml file for your webapp. servlet_1 com.xyz.Servlet1 servlet_1 /runServletNumberOne As shown above, you can map any URL you like to your servlet, even more than one URL can map to the same servlet if you want. The "servlet-name" tag is really only there to link the mapping with the class definition, it can be any string you want. And the servlet class can be anywhere in the CLASSPATH, though it is usually best to put it under WEB-INF/classes. File $TOMCAT_HOME/conf/web.dtd defines what tags can be included in your webapp's WEB-INF/web.xml file. Hope this helps, Simon