properties文件读取
作者:互联网
方式一:ResourceBundle(常用)
ResourceBundle bundle = ResourceBundle.getBundle("文件名")
bundle.getString("字段名")
方式二:ClassLoad
InputStream in = 类名.class.getClassLoader().getResourceAsStream("XXX.properties");
Properties props = new Properties();
props .load(in)
props.getProperty(key)
方式三:spring 加载配置文件方式
标签:文件,读取,方式,bundle,properties,ResourceBundle,props,Properties 来源: https://www.cnblogs.com/wanggfIT/p/16519968.html