2012-06-13 117 views
0

当我尝试使用util:属性从文件系统加载属性文件时,找不到属性文件。我把它放在我的根驱动器和所有类型的地方,但我似乎无法使用util:属性从文件系统加载属性文件。使用util:属性从文件系统加载属性文件?

可以做到这一点吗?

<util:properties id="configProperties" location="file:///d:/config.properties"/> 

从类路径加载它工作正常..但我想配置应用程序,以便系统管理员可以更改属性。

<util:properties id="configProperties" location="classpath:/config.properties"/> 

回答

4

我有这样的一个Linux项目,它工作正常:

<util:properties id="jdbcConfiguration" location="file:///home/reporting/jdbc.properties"/> 

所以问题可能是与您指定的路径的方式。试着这样说:

<util:properties id="configProperties" location="file:d:/config.properties"/> 
+0

感谢您的答复..我确信我在深夜这个昨天试过..但我犯了一个错误:)我有UTIL:在2个不同的Spring XML文件的属性,都指向一个错误的位置..我清理它,实施你的建议,它的作品完美! – Marco

相关问题