Results 1 to 2 of 2

Thread: system-properties-mode gone from 3.1.0.RC1?

  1. #1

    Question system-properties-mode gone from context:property-placeholder in 3.1?

    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 at 05:11 PM.
    javapda on forum

  2. #2
    Join Date
    Oct 2011
    Posts
    15

    Default

    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).

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •