Java – Tomcat spring and environment variables

In the spring file, I have:

<bean id="propertyConfigurer" class="org.myapp.MyConfigurator">
        <property name="locations">
        <list>
                       <value>classpath:configuration-${env}.properties</value>
        </list>
    </property>
</bean>

The ${env} variable is defined in Maven's configuration file But when I run the application in Tomcat 6 (released) from eclipse, it doesn't look like Maven So how do I set variables for Tomcat?

thank you

randomization

Solution

Add system variables in Eclipse: go to run – > run configuration – > select the arguments tab of Tomcat and add them to the VM parameter - DENV = blablabla

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>