I'd like to read a properties file in my applications WEB-INF folder or my tomcat/apache server from a JAAS loginModule. But I'm not understanding how to properly refer to the location from the LoginModule, in a host name independent manner.
A:
Can't you put your properties in login.conf instead of in a properties file?
Maurice Perry
2009-03-03 06:49:18
I already have properties in the login.conf file but I wanted to use the same properties file as my spring application so as to reduce the amount of configuration proliferation i'm experiencing.
Martlark
2009-03-04 23:46:14
+1
A:
You could use the catalina.base system property:
File confDir = new File(System.getProperty("catalina.base"), "conf");
File confFile = new File(confDir, "myprops.properties");
InputStream in = new FileInputStream(confFile);
try {
props.load(in);
} finally {
in.close();
}
Maurice Perry
2009-03-05 07:16:44