我有一个属性文件,我想加载到系统属性,以便我可以通过System.getProperty("myProp")
访问它。目前,我正在尝试使用Spring <context:propert-placeholder/>
像这样:如何在Spring中加载系统属性文件?
<context:property-placeholder location="/WEB-INF/properties/webServerProperties.properties" />
然而,当我尝试通过System.getProperty("myProp")
我越来越null
访问我的属性。我的属性文件看起来像这样:
myProp=hello world
我怎么能做到这一点?我很确定我可以设置运行时参数,但是我想避免这种情况。
谢谢!
也许[这个相关的问题(http://stackoverflow.com/questions/1311360/property-placeholder-location-from-another-property)给出了一些方向? – Raghuram 2010-11-07 06:12:17