Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@www.apache.org Received: (qmail 94911 invoked from network); 10 Aug 2004 17:23:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 10 Aug 2004 17:23:55 -0000 Received: (qmail 37013 invoked by uid 500); 10 Aug 2004 17:23:21 -0000 Delivered-To: apmail-jakarta-tomcat-user-archive@jakarta.apache.org Received: (qmail 36961 invoked by uid 500); 10 Aug 2004 17:23:20 -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 36873 invoked by uid 99); 10 Aug 2004 17:23:19 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [216.199.173.5] (HELO conviveon.net) (216.199.173.5) by apache.org (qpsmtpd/0.27.1) with ESMTP; Tue, 10 Aug 2004 10:23:15 -0700 Received: from [192.168.1.10] (unverified [216.199.116.163]) by conviveon.net (SurgeMail 2.0f) with ESMTP id 9282168 for ; Tue, 10 Aug 2004 13:23:12 -0400 User-Agent: Microsoft-Entourage/10.1.4.030702.0 Date: Tue, 10 Aug 2004 13:23:12 -0400 Subject: SOLVED: How to get the context path for a web application? From: Dov Rosenberg To: Tomcat Users List Message-ID: In-Reply-To: <003f01c47efc$798145b0$3201a8c0@rasta> Mime-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit X-Server: High Performance Mail Server - http://surgemail.com X-Authenticated-User: dov.rosenberg Domain conviveon.net X-DNS-Paranoid: DNS lookup of (216.199.116.163) failed X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Someone on the list suggested Request.getContextPath() and it works like a charm. Thanks to all. On 8/10/04 1:06 PM, "David Wall" wrote: >> A ServletConfig reference is passed in the call to the init() method of > your >> servlet. From this you may use the getServletContext() method to get the >> context. One thing to remember is that this does not get called until the >> servlet is initialized and would be invalidated when it is destroyed. I > suggest >> you check the API docs for more information. > > But do any of those return the context path? I didn't see it anywhere in > the javadocs. > > David > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: tomcat-user-help@jakarta.apache.org > -- Dov Rosenberg Conviveon Corporation http://www.conviveon.com --------------------------------------------------------------------- To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: tomcat-user-help@jakarta.apache.org