AnsweredAssumed Answered

Providing parameters from context.xml

Question asked by eren on Sep 20, 2011
Latest reply on Sep 20, 2011 by ronald.van.kuijk
Hi,

Could you use ServletContextPropertyPlaceholderConfigurer instead of PropertyPlaceholderConfigurer. In this way we can set parameters (database driver, database url etc) through context.xml (Tomcat). Moreover, we can deploy single war file to any environment without modifying the content.

This could also be applied to Activit Rest.


    <bean class="org.springframework.web.context.support.ServletContextPropertyPlaceholderConfigurer">
        <property name="searchContextAttributes" value="true"/>
        <property name="contextOverride" value="true"/>
        <property name="ignoreResourceNotFound" value="true"/>
        <property name="locations">
            <list>
                <value>classpath:db.properties</value>
            </list>
        </property>
    </bean>

Thanks,
Eren

Outcomes