Announcement Announcement Module
Collapse
No announcement yet.
Placeholder not being replaced in xml context file? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Placeholder not being replaced in xml context file?

    I am trying to display the specified spring profile to web users of my MVC application. To do this I have been trying to set spring.profiles.active as a property for my PropertiesFactoryBean, however when I query this property I am returned the placeholder, ie "${spring.profiles.active}", why isn't the placeholder being replaced? Is there a better approach to this problem? I am using Spring 3.1.

    Code:
    <beans:bean id="dbProperties"
    		class="org.springframework.beans.factory.config.PropertiesFactoryBean">
    	<beans:property name="location"
    		value="classpath:connection.${spring.profiles.active}.properties"/>
    	<beans:property name="properties">
    		<beans:props>
    			<beans:prop key="profile.active">${spring.profiles.active}</beans:prop>
    		</beans:props>
    	</beans:property>
    	</beans:bean>
Working...
X