2009-03-03 42 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