Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@www.apache.org Received: (qmail 21735 invoked from network); 10 Aug 2004 17:59:51 -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:59:51 -0000 Received: (qmail 98727 invoked by uid 500); 10 Aug 2004 17:59:10 -0000 Delivered-To: apmail-jakarta-tomcat-user-archive@jakarta.apache.org Received: (qmail 98608 invoked by uid 500); 10 Aug 2004 17:59:09 -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 98590 invoked by uid 99); 10 Aug 2004 17:59:09 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [63.244.250.132] (HELO mustang.mpi.com) (63.244.250.132) by apache.org (qpsmtpd/0.27.1) with ESMTP; Tue, 10 Aug 2004 10:59:08 -0700 Received: from thunderbolt.mpi.com (thunderbolt [63.244.253.70]) by mustang.mpi.com (Switch-3.1.6/Switch-3.1.6) with ESMTP id i7AHrdMH005816; Tue, 10 Aug 2004 13:53:39 -0400 (EDT) Received: from US-VS1.corp.mpi.com (us-be2.corp.mpi.com [63.244.252.32]) by thunderbolt.mpi.com (Switch-3.1.4/Switch-3.1.0) with ESMTP id i7AHvVQk010048; Tue, 10 Aug 2004 13:57:32 -0400 (EDT) X-MimeOLE: Produced By Microsoft Exchange V6.0.6487.1 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: SOLVED: How to get the context path for a web application? Date: Tue, 10 Aug 2004 13:57:40 -0400 Message-ID: <9C5166762F311146951505C6790A9CF801FC38EA@US-VS1.corp.mpi.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: SOLVED: How to get the context path for a web application? Thread-Index: AcR/Ag/CrKa8z1ljQr+2xDQgO5e1pAAAMFmw From: "Shapira, Yoav" To: "Tomcat Users List" , "David Wall" X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N H= i, >True and it's mostly not a big issue. However, is it possible for a >ServletContext to reference one context path and the Request objects = to >have >a different one? Most webapps only operate under a single context pa= th >(don't they?), so having it at initialization would be nice too. Oh >well... >With the path, I could build URLs for email and other logging info at= >initialization that cannot be done dynamically without knowing the >host/port/contextpath. All webapps operate under one context path: that's a one to one relationship at the core of the Servlet Specification. Note that one reason the ServletContext object does have a context pat= h is that the latter is an HTTP-specific concept. (One has to be very careful here as these terms are used interchangeably). The ServletContext and ServletConfig objects are explicitly protocol-independent. Specifically, what the ServletContext JavaDoc calls "uripath" may or may not correspond to a path on the hard-drive and in the Request#getContextPath method. There's more to this but I have to run to a meeting ;) Yoav Shapira This e-mail, including any attachments, is a confidential business com= munication, and may contain information that is confidential, propriet= ary and/or privileged. This e-mail is intended only for the individua= l(s) to whom it is addressed, and may not be saved, copied, printed, d= isclosed or used by anyone else. If you are not the(an) intended reci= pient, please immediately delete this e-mail from your computer system= and notify the sender. Thank you. --------------------------------------------------------------------- To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: tomcat-user-help@jakarta.apache.org