<context:property-placeholder ignore-unresolvable="true" location="classpath:test.properties" />
Run Code Online (Sandbox Code Playgroud)
上面提到的从contex:property-placeholder加载属性文件的方法很好.我想要做的是从文件系统加载属性文件.
假设我有C盘中的文件C:\spring\test.properties.在这里我如何使用加载文件 context:property-placeholder.
使用file:URL而不是classpath:一个
<context:property-placeholder ignore-unresolvable="true"
location="file:/C:/spring/test.properties" />
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
6035 次 |
| 最近记录: |