Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@apache.org Received: (qmail 39263 invoked from network); 27 Feb 2002 19:03:52 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 27 Feb 2002 19:03:52 -0000 Received: (qmail 12819 invoked by uid 97); 27 Feb 2002 19:03:23 -0000 Delivered-To: qmlist-jakarta-archive-tomcat-user@jakarta.apache.org Received: (qmail 12803 invoked by uid 97); 27 Feb 2002 19:03:23 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Users List" Reply-To: "Tomcat Users List" Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 12782 invoked from network); 27 Feb 2002 19:03:22 -0000 Message-ID: <5A0B864991270148B1E2AA3D0BB92D42266F@grappelli.fiddler.com> From: "Mark B. Indictor" To: 'Tomcat Users List' Subject: RE: REPOST: Please HELP!: URL Mapping Problems in servlet Date: Wed, 27 Feb 2002 11:03:06 -0800 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C1BFC1.6399C620" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N ------_=_NextPart_001_01C1BFC1.6399C620 Content-Type: text/plain I appreciate the help, but this still does not solve my problem. You see, I need to handle URLs of the following forms: http://hostname/context/servlet/xxx as well as: http://hostname/context/servlet With your suggestion, I would be truncating these to: http://hostname/context/servlet and http://hostname/context Respectively. The first behavior is desirable, the second is not! What I do not understand is why Apache and Tomcat conspire hide the 'context' element of the URL. I either need to find a way to isolate and retrieve the full path to the servlet (/context/servlet) or I need to find a way to set up Apache and Tomcat to recognize a URL that does not contain a context component (/servlet). Why does getServletPath() not return the whole path to the servlet, including its context, if this information is, in fact, required to access the servlet with a URL!? Any suggestions? Thanks! - mbi ====================================================== Mark Indictor -- Site2 Corporation mbi@site2.com Phone:(310)451-3472 FAX:(240)220-6341 http://keyserver.pgp.com/pks/lookup?op=get&search=0x8959F966 ====================================================== -----Original Message----- From: Cox, Charlie [mailto:ccox@cincom.com] Sent: Wednesday, February 27, 2002 10:44 AM To: 'Tomcat Users List' Subject: RE: REPOST: Please HELP!: URL Mapping Problems in servlet I don't think there is a function to get the full request path without the final page/servlet name. This should get what you need: req.getRequestURI().substring(0,req.getRequestURI().lastIndexOf("/")) ------_=_NextPart_001_01C1BFC1.6399C620--