【发布时间】:2012-06-05 12:41:05
【问题描述】:
这里有一篇关于 Spring 的博客: http://blog.springsource.org/2011/02/15/spring-3-1-m1-unified-property-management/
它引入了一个新功能:导入标签中的用户占位符。
例如:<import resource="com/bank/service/${customer}-config.xml"/>
嗯,我也是 3.1。
然后,当我启动 MYAPP 时,奇迹并没有发生..
这是我的代码: (sourceFolder 中的 config.properties):
kName = P0765
(春天的 xml):
<bean id="placeholderConfig" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">;
<property name="location" value="classpath:config.properties" >;
</bean>
<import resource="readyData/${KName}.xml"/>
:( 什么工作没做?
【问题讨论】:
-
属性区分大小写。 ${KName}.xml 中的“K”字符为大写,config.properties 中的“k”字符为小写。
标签: java spring placeholder