我正在尝试将 PropertyPlaceholderConfigurer 与外部属性文件一起使用,该文件不是 WAR 文件的一部分。
我将bean配置如下:
<property name="location" value="${jboss.server.data.dir}/my-dir/common.properties"/>
部署 WAR 文件时,我收到一条错误消息:
.....无法加载属性;嵌套异常是 java.io.FileNotFoundException: 无法打开 ServletContext 资源 [/C:/dir/jboss-as-7.1.1.Test/standalone/data/my-dir/common.properties]
有什么办法可以将属性文件放在 WAR 文件之外?