Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@www.apache.org Received: (qmail 20167 invoked from network); 10 Aug 2004 17:57:11 -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:57:11 -0000 Received: (qmail 94397 invoked by uid 500); 10 Aug 2004 17:56:45 -0000 Delivered-To: apmail-jakarta-tomcat-user-archive@jakarta.apache.org Received: (qmail 94354 invoked by uid 500); 10 Aug 2004 17:56:44 -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 94338 invoked by uid 99); 10 Aug 2004 17:56:44 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [206.163.82.92] (HELO integraonline.com) (206.163.82.92) by apache.org (qpsmtpd/0.27.1) with SMTP; Tue, 10 Aug 2004 10:56:42 -0700 Received: (qmail 5496 invoked from network); 10 Aug 2004 17:57:17 -0000 Received: from unknown (HELO RESEARCH2) (?pbs?robert.iat-cti.com@208.46.68.194) by 0 with SMTP; 10 Aug 2004 17:57:17 -0000 Reply-To: From: "Robert Harper" To: "'Tomcat Users List'" , "'David Wall'" Subject: RE: SOLVED: How to get the context path for a web application? Date: Tue, 10 Aug 2004 11:57:26 -0600 Message-ID: <001901c47f03$7ff7c430$297ba8c0@RD.IATCTI.COM> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.4510 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 In-Reply-To: <00c901c47eff$3e6b0da0$3201a8c0@rasta> Importance: Normal X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N If you set your container to start a pool of servlets when it starts, = the init should be called then. I'm not sure how to set Tomcat to start up a pool = of "Keep alive" servlets. You'll have to consult the docs for that. The = init is called when the servlet is instantiated and should be called before = requests are made if the servlet is started before request arrive. I have done this = with other servlet containers. Robert S. Harper 801.265.8800 ex. 255 > -----Original Message----- > From: David Wall [mailto:d.wall@computer.org] > Sent: Tuesday, August 10, 2004 11:27 AM > To: Tomcat Users List > Subject: Re: SOLVED: How to get the context path for a web = application? >=20 > > Someone on the list suggested Request.getContextPath() and it works = like a > > charm. Thanks to all. >=20 > Agreed, but my follow-up question was if there was such a call to be = done > using a ServletContext/ServletConfig object so that you can get the = context > path in initialization servlets, etc., before a request comes in. >=20 > David >=20 >=20 > > >> 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. >=20 >=20 > --------------------------------------------------------------------- > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: tomcat-user-help@jakarta.apache.org >=20 --------------------------------------------------------------------- To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: tomcat-user-help@jakarta.apache.org