InputStream propFile = (InputStream) ReadPropertyFile.class.getResourceAsStream(“common.properties”);
这个没有使用
InputStream propFile = (InputStream) ReadPropertyFile.class.getClassLoader.getResourceAsStream(“common.properties”);
是因为common.properties我放在了编译后的classes文件夹下的子文件里面,如果放在编译后的classes文件夹下则要使用.getClassLoader
读取property配置文件
最新推荐文章于 2022-11-10 13:21:57 发布