Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@apache.org Received: (qmail 49957 invoked from network); 7 Aug 2002 22:50:45 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 7 Aug 2002 22:50:45 -0000 Received: (qmail 12085 invoked by uid 97); 7 Aug 2002 22:50:49 -0000 Delivered-To: qmlist-jakarta-archive-tomcat-user@jakarta.apache.org Received: (qmail 12048 invoked by uid 97); 7 Aug 2002 22:50:48 -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 12032 invoked by uid 98); 7 Aug 2002 22:50:47 -0000 X-Antivirus: nagoya (v4198 created Apr 24 2002) From: "Robert Baker" To: "Tomcat Users List" Subject: (SOLVED) Location of application-specific properties files Date: Wed, 7 Aug 2002 18:50:20 -0400 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Importance: Normal In-Reply-To: <5.1.0.14.2.20020806223606.03af6070@shell.visi.com> X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N The first of your three examples below works just great. I haven't tried the other two yet, but I will. Thanks! Bob -----Original Message----- From: Jacob Kjome [mailto:hoju@visi.com] Since you want to avoid this so that your app is not servlet specific, you can do the following.... load(CurrentClass.class.getResourceAsStream("/myprops.properties")); or load(CurrentClass.class.getClassloader().getResourceAsStream("myprops.proper ties")); or load(Thread.currentThread().getContextClassLoader().getResourceAsStream("myp rops.properties")); Notice in all the cases where you are looking in the classpath/classloader, you do not reference "WEB-INF" or the "classes" directory within WEB-INF. The classloader doesn't know about those. The ServletContext, on the other hand, knows about everything inside the root of the current webapp. -- To unsubscribe, e-mail: For additional commands, e-mail: