L
laredotornado
Hi,
I'm building a WAR file and trying to figure out where I can put my
properties files within it such that they will be available on the
classpath. Currently, I've tried WEB-INF/classes/mine.properties and
WEB-INF/lib/mine.properties without luck. That is, after I deploy my
WAR file and access my JSP with this code:
java.util.Properties props = new java.util.Properties();
ClassLoader cl = this.getClass().getClassLoader();
InputStream input =
cl.getResourceAsStream( "mine.properties" );
if (input == null) {
out.println("can't find properties.");
} else {
props.load(input);
out.println(props);
} // if
what is printed out is "can't find properties". I'm sure I'm missing
something really obvious. Your help is appreciated, - Dave
I'm building a WAR file and trying to figure out where I can put my
properties files within it such that they will be available on the
classpath. Currently, I've tried WEB-INF/classes/mine.properties and
WEB-INF/lib/mine.properties without luck. That is, after I deploy my
WAR file and access my JSP with this code:
java.util.Properties props = new java.util.Properties();
ClassLoader cl = this.getClass().getClassLoader();
InputStream input =
cl.getResourceAsStream( "mine.properties" );
if (input == null) {
out.println("can't find properties.");
} else {
props.load(input);
out.println(props);
} // if
what is printed out is "can't find properties". I'm sure I'm missing
something really obvious. Your help is appreciated, - Dave