Context namespace exposes value-separator attribute for property-placeholder element

Issue: SPR-7794
This commit is contained in:
Juergen Hoeller
2015-09-23 22:39:23 +02:00
parent c7fd4ccf48
commit a23629f60f
5 changed files with 41 additions and 25 deletions

View File

@@ -11,4 +11,8 @@
<constructor-arg value="${foo}"/>
</bean>
<bean id="fallback" class="java.lang.String">
<constructor-arg value="${bar:none}"/>
</bean>
</beans>

View File

@@ -2,18 +2,22 @@
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsd">
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.2.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.2.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-4.2.xsd">
<util:properties id="placeholderProps">
<prop key="foo">bar</prop>
</util:properties>
<context:property-placeholder properties-ref="placeholderProps" system-properties-mode="OVERRIDE"/>
<context:property-placeholder properties-ref="placeholderProps" system-properties-mode="OVERRIDE" value-separator="?"/>
<bean id="string" class="java.lang.String">
<constructor-arg value="${foo}"/>
</bean>
<bean id="fallback" class="java.lang.String">
<constructor-arg value="${bar?none}"/>
</bean>
</beans>