Reading properties file from WEB-INF/classes

D

Dundonald

Properties file stored in WEB-INF/classes.

There are numerous ways to read properties files, but I'd like to know
what your opinions are on the best way to read from the WEB-INF/
classes directory given that I could deploy my war file to any server
on any platform not knowing how a server is configured, i.e. with its
real paths etc.
 
M

Manish Pandit

Properties file stored in WEB-INF/classes.

There are numerous ways to read properties files, but I'd like to know
what your opinions are on the best way to read from the WEB-INF/
classes directory given that I could deploy my war file to any server
on any platform not knowing how a server is configured, i.e. with its
real paths etc.

getResourceAsStream() should give you the resouece that is in WEB-INF/
classes.

http://java.sun.com/j2se/1.4.2/docs...er.html#getResourceAsStream(java.lang.String)

-cheers,
Manish
 
L

Lew

Dundonald said:
Properties file stored in WEB-INF/classes.

There are numerous ways to read properties files, but I'd like to know
what your opinions are on the best way to read from the WEB-INF/
classes directory given that I could deploy my war [sic] file to any server
getResourceAsStream() should give you the resouece that is in WEB-INF/
classes.

http://java.sun.com/j2se/1.4.2/docs...er.html#getResourceAsStream(java.lang.String)
(Also available from java.lang.Class.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,053
Latest member
BrodieSola

Latest Threads

Top