Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How do I read a properties file in WEB-INF without hard-coding a path?

843841Apr 13 2004 — edited Apr 14 2004
Hello,

How do I read a properties file in WEB-INF without hard-coding a path?

I tried:
Properties properties = new Properties();
properties.load(new FileInputStream("db.properties"));
driver = properties.getProperty("driver");

but it cannot find the db.properties file.

Thanks for the help.

Frank
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 12 2004
Added on Apr 13 2004
7 comments
581 views