首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 其他教程 > 操作系统 >

Jar或Jboss里没法读取配置文件

2013-10-27 
Jar或Jboss里无法读取配置文件以前是通过这种方式加载配置文件:private static void init() {props new

Jar或Jboss里无法读取配置文件

以前是通过这种方式加载配置文件:

        private static void init() {props = new Properties();load();}private static void load() {try {props.load(PropertyUtil.class.getClassLoader().getResourceAsStream("ApplicationResources.properties"));} catch (IOException e) {throw new RuntimeException(e);}}

就没有问题了,在此记录一下。


热点排行