tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Justin Ruthenbeck <>
Subject Re: Setting Path for properties file
Date Wed, 21 Aug 2002 21:46:59 GMT

Jillian --

Instead of loading the properties from the file, you can load it 
dynamically as a system resource, then pass the InputStream into a new 
Properties object.  This way, you'll be able to load the properties file 
from anywhere in the classpath instead of just a hardcoded logical path in 
the filesystem.  For example:

Properties props = new Properties(inStream);

The properties file will be loaded by the ClassLoader associated with your 
webapp, so you'll have to put the props file in a directory that that 
ClassLoader can access.  I've never tried it, but I would think you could 
just place it in the WEB-INF/lib directory (can anyone confirm/refute?) 
directly.  If not, you could always jar it up and place it there.


At 02:19 PM 8/21/2002, you wrote:
>I am using a properties file for my Java Beans/classes to reference
>directly.  I am having problems determining where I specify the path so that
>my classes can find the file in my application's directory. Right now the
>only way I can read the file is if I put it in my Tomcat\bin directory.  I
>would like to be able to put the file in my application's directory
>structure instead of into Tomcat's.  Is there a way to specify this?
>Jillian Reiman
>Phone:  612-667-8741
>To unsubscribe, e-mail:   <>
>For additional commands, e-mail: <>

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message