Could you get the resource URL of the class loading the properties file, and
then strip off the package and class name? e.g. if Im loading bob.properties
from class Bob in package com/fred/, my resource url for the class would be
/usr/tomcat/webapps/mycontext/WEB-INF/classes/com/fred/Bob.class. If I strip
off the package names and the Bob.class I'd get the path to a props file in
the root. You'll have to play around with this if the class is in a jar
file. Likewise, when loading the props file using the string name, remember
to use File.seperator rather than hardcoding a forward slash.
sam
----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, April 17, 2001 9:27 PM
Subject: How to read property files?
> I would like to put a myapp.properties file in the top level directory
> of my webapp. But I can't figure out what filepath to give the
> Properties.load() method in order to load my servlet property object.
> Can someone help me?
>
> Thanks
>
> =eas=
>