From the documentation for java.lang.ClassLoader:
" The name of a resource is a "/"-separated path name that identifies
the resource."
That is, try /resources/storageDirectory.properties.
Caroline Jen wrote:
Okay, this code works if I put the properties file in
the WEB-INF\classes directory:
fina
Okay, this code works if I put the properties file in
the WEB-INF\classes directory:
final String PROPFILE = "storageDirectory.properties";
Properties oProp = null;
oProp = new Properties();
oProp.load(
getClass().getClassLoader().getResourceAsStream(
PROPFILE ) );
I really would like to
I tried:
final String PROPFILE = "storageDirectory.properties";
Properties oProp = null;
oProp = new Properties();
oProp.load(
getClass().getClassLoader().getResourceAsStream(
PROPFILE ) );
Now, I got:
java.lang.NullPointerException
java.io.Reader.(Reader.java:61)
java.io.InputSt
Hi, Caroline.
Your code tries to open a file from the filesystem, and since the path you specified
is invalid from the current working directory you get a FileNotFoundException.
Try a
oProp
new Properties().load (getClass().getClassloader().getResourceAsStream(PROPFILE));
Hiran
--
4 matches
Mail list logo