Announcement Announcement Module
Collapse
No announcement yet.
One PropertyPlaceholderConfigurer across multiple contexts Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • One PropertyPlaceholderConfigurer across multiple contexts

    I've got several debug flags (properties) that I've consolidated into one properties file. I'd like to use the PropertyPlaceholderConfigurer to replace these properties regardless of which *Context.xml or *-servlet.xml file in which they exist.
    If I declare the bean
    Code:
    <bean id="propertyOverrideConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer" lazy-init="false">
            <property name="location">
                <value>WEB-INF/placeholder.properties</value>
            </property>
            <property name="order"><value>1</value></property>
        </bean>
    in the applicationContext.xml, app-servlet.xml doesn't know how to replace the placeholders. However, if I declare the same PropertyPlaceholderConfigurer bean in app-servlet.xml, it works fine.
    I know I'm missing something dumb. Any help would be much appreciated.

    - Justin

  • #2
    You must configure one PropertyPlaceholderConfigurer for applicationContext.xml and another for app-servlet.xml.
    HTH

    Comment

    Working...
    X