2009-03-03 57 views

回答

1

您可以使用catalina.base系统属性:

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(); 
} 
+0

很好的解决方案。谢谢你的帮助。 – Martlark 2009-03-10 00:35:01