Reading properties file from WEB-INF/classes

Reading properties file from WEB-INF/classes

Post by Dundonal » Mon, 08 Oct 2007 17:23:56


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.
 
 
 

Reading properties file from WEB-INF/classes

Post by Manish Pan » Mon, 08 Oct 2007 18:52:21


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

http://www.yqcomputer.com/ #getResourceAsStream(java.lang.String)

-cheers,
Manish

 
 
 

Reading properties file from WEB-INF/classes

Post by Lew » Tue, 09 Oct 2007 00:54:51


(Also available from java.lang.Class.)

< http://www.yqcomputer.com/ #getResourceAsStream(java.lang.String)>
will do the same thing rooted at the application context.
...
...

--
Lew