getPropsFromWebINF works so long as the properties file is within the package of
the class (/. However, I'd like to put the properties file under WEB-INF:
public void getPropsFromWebINF() throws IOException {
Properties p = new Properties();
InputStream is;
is = getClass().getResourceAsStream("sqljdbc4.properties");
p.load(is);
log(p.toString());
}
I've seen mention of using:
System.getenv("APP_PROPERTIES");
in conjunction with a context (context.xml under META-INF) along the lines of:
<?xml version="1.0" encoding="UTF-8"?>
<Context antiJARLocking="true" path="/A00720398sat">
<Environment name="APP_PROPERTIES"
description="The APP Properties File" override="false"
type="java.lang.String"
value="/WEB-INF/app.properties" />
</Context>
however, I'm not able to get the environment, I just get a null value.
What's the correct, and simple, idiom? (Staying away from jndi and dbcp for
now, and, oddly enough, servlets in this case.)
Actually, I suppose in a sense it's in WEB-INF:
dtc01l0376-06:~ a00720398$
dtc01l0376-06:~ a00720398$ jar -tfv
NetBeansProjects/A00720398sat/dist/A00720398sat.war | grep sql
498 Sat Apr 17 14:36:14 PDT 2010
WEB-INF/classes/controller/sqljdbc4.properties
however, I'd like to move it from WEB-INF/classes up to just WEB-INF.
thanks,
Thufir
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]