Spring placeholder format

This is the syntax that works

<bean id="placeholderConfig" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="location" value="classpath:application.properties"/> <property name="systemPropertiesModeName" value="SYSTEM_PROPERTIES_MODE_OVERRIDE"/> </bean> 

This is an alternative format that does NOT work.

  <context:property-placeholder location="classpath:application.properties" system-properties-mode="OVERRIDE"/> 

Any ideas why? I will always be crazy on construction tests.

The application properties file contains only this hibernate.show.sql = false hibernate.format.sql = true

-1
source share
1 answer

Your syntax looks correct. Do you have a context namespace registered in your context file?

For instance:

 <beans ... xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation="... http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd"> 
+1
source

All Articles