如何解决从另一个.properties文件访问一个.properties文件中的值
考虑2个属性文件:
- abc.properties
- bcd.properties
我需要从bcd.properties中的abc.properties获取字符串。 使用CompositeConfiguration我得到了解决方案,但是在我的项目中不是通用解决方案。请提出一种使用ResourceBundle本身的方法。
分享我所做的事情:
ResourceBundle inStream = ResourceBundle.getBundle("bcd",Locale.US);
Properties test = new Properties();
String keys = inStream.getString("Email");
System.out.println("Result here "+keys);
abc.properties :
Email=Not a valid email address
bcd.properties :
include = abc.properties
//some strings
希望您能解决我的问题。 预先感谢!
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。