tomcat: web项目下获取Properties配置文件内容
// 设配置文件config.properties在com.example包下
try {
InputStream is = 当前类类名.class.getClassLoader().
getResourceAsStream("com/example/config.properties");
Properties prop = new Properties();
prop.load(is);
String value = prop.getProperty("key");
is.close(
原创
2021-05-29 23:26:45 ·
458 阅读 ·
0 评论