cmmon-Configuration动态对去配置文件

static{
		try {
			config = new PropertiesConfiguration("jeesite.properties");
			FileChangedReloadingStrategy strategy =new FileChangedReloadingStrategy();
			strategy.setRefreshDelay(5000);//每隔5秒查询一次文件是否修改
			config.setReloadingStrategy(strategy);
		} catch (ConfigurationException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}


String value = config.getString(key);

猜你喜欢

转载自sanniangmiao.iteye.com/blog/2261661
今日推荐