private String getData(String key) {
InputStream inputStream = this.getClass().getClassLoader()
.getResourceAsStream("conf/upload-image.properties");
Properties p = new Properties();
try {
p.load(inputStream);
} catch (IOException e1) {
e1.printStackTrace();
}
return p.getProperty(key);
}
jsp 读取配置文件
最新推荐文章于 2023-04-07 13:24:32 发布
本文提供了一个使用Java从特定属性文件中加载配置信息的例子。通过`Properties`类,演示了如何获取`upload-image.properties`文件中的指定键值。

1148

被折叠的 条评论
为什么被折叠?



