Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tomcat 3.3: load property file

Status
Not open for further replies.

robertg2

Programmer
Apr 30, 2002
1
DE
Hi!
with Tomcat 3.2 I used the class Properties to read an own config file. The file is searched at the CLASSPATH. Unfortunately this works no longer with Tomcat 3.3.1, cause there the environmental CLASSPATH is not used resp. Tomcat sets it anew. Copying the file into any of the lib directories doesn't help either.
The code is in a library - not in a jsp. I would appreciate being able to load the file from every web application - not only from within the appls dir tree.
Any ideas?
Thanx!
Robert

The Code:
private final static String PROP_PATH = "/myappl.properties";
...
Properties prop = new Properties();
InputStream is = prop.getClass()
.getResourceAsStream(PROP_PATH);
try {
prop.load(is);
} catch
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top