Announcement Announcement Module
Collapse
No announcement yet.
system-properties-mode gone from 3.1.0.RC1? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • system-properties-mode gone from 3.1.0.RC1?

    I have a spring configuration that is using the new 3.1 schemas. But I noticed that the system-properties-mode no longer seems to be available when setting up context: property-placeholder.

    Q: Has system-properties-mode been replaced?

    Q: Has system-properties-mode been removed from property-placeholder?


    3.1 Schema in spring-context-3.1.xsd in org.springframework.context-3.1.0.BUILD-SNAPSHOT.jar:
    Code:
    	<xsd:element name="property-placeholder">
    		<xsd:annotation>
    			<xsd:documentation><![CDATA[
    	Activates replacement of ${...} placeholders, resolved against the specified properties file or
    	Properties object (if any). Defines a PropertySourcesPlaceholderConfigurer within the context.
    	For backward compatibility with versions earlier than Spring 3.1, a PropertyPlaceholderConfigurer will be
    	registered if the 'system-properties-mode' attribute has been explicitly assigned a value.
    			]]></xsd:documentation>
    			<xsd:appinfo>
    				<tool:annotation>
    					<tool:exports
    						type="org.springframework.context.support.PropertySourcesPlaceholderConfigurer" />
    				</tool:annotation>
    			</xsd:appinfo>
    		</xsd:annotation>
    		<xsd:complexType>
    			<xsd:complexContent>
    				<xsd:extension base="propertyPlaceholder" />
    			</xsd:complexContent>
    		</xsd:complexType>
    	</xsd:element>
    3.0 Schema in spring-context-3.0.xsd in org.springframework.context-3.1.0.BUILD-SNAPSHOT.jar:
    Code:
    	<xsd:element name="property-placeholder">
    		<xsd:annotation>
    			<xsd:documentation><![CDATA[
    	Activates replacement of ${...} placeholders, resolved against the specified properties file or
    	Properties object (if any). Falls back to resolving placeholders against JVM system properties.
    	Alternatively, define a parameterized PropertyPlaceholderConfigurer bean in the context.
    			]]></xsd:documentation>
    			<xsd:appinfo>
    				<tool:annotation>
    					<tool:exports
    						type="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer" />
    				</tool:annotation>
    			</xsd:appinfo>
    		</xsd:annotation>
    		<xsd:complexType>
    			<xsd:complexContent>
    				<xsd:extension base="propertyPlaceholder">
    					<xsd:attribute name="system-properties-mode" default="FALLBACK">
    						<xsd:simpleType>
    							<xsd:restriction base="xsd:string">
    								<xsd:enumeration value="NEVER"/>
    								<xsd:enumeration value="FALLBACK"/>
    								<xsd:enumeration value="OVERRIDE"/>
    							</xsd:restriction>
    						</xsd:simpleType>
    					</xsd:attribute>
    				</xsd:extension>
    			</xsd:complexContent>
    		</xsd:complexType>
    	</xsd:element>
    Last edited by javapda; Nov 17th, 2011, 06:11 PM.

  • #2
    In Spring 3.1, it is encouraged to use PropertySourcesPlaceholderConfigurer instead of PlaceholderConfigurerSupport unless (a) one is using BeanFactory and (b) existing configuration uses systemPropertiesMode. In spring-context-3.0.xsd the default setting is being assigned to fallback whereas in spring-context-3.1, the default is not assigned. I think you need to explicitly assign value systemPropertiesMode (which itself has been given for backward compatibility).

    Comment

    Working...
    X