我必须从WildFly中读取属性文件,这是在使用spring的野蛮外战中,我在spring中使用PropertyPlaceholderConfigurer尝试了它,并且它正在工作,但有一个问题。使用弹簧从外部路径加载属性文件
的applicationContext.xml
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="location">
<value>file:/C:\wildfly-9.0.2.Final\wildfly-9.0.2.Final\standalone\deployments\/propertyLoader.properties</value>
</property>
</bean>
<bean id="getPropertyBean"
class="com.csc.loadProperty.GetProperty">
<property name="prefixProp" value="${prefix}" />
<property name="suffixProp" value="${suffix}" />
<property name="newProp" value="${new}" />
</bean>
这里我给了propertyLoader.properties绝对路径,但我必须从服务器给相对路径的路径可以是不同的机器不同。谁能帮我?