开发者

how do i get values from a properties file in quartz scheduler?

I'm using spring 2.0.6 and quartz 1.5.2 in a java based webapp. Want to know how to configure my applicationContext-quartz.xml such that i can read values from a properties file. i.e. I would like to have my file read

<property name="imageFolder" value="${config.imageFolder}" />
<property name="rawImageFolder" value="${config.rawImageFolder}" />
<property name="imageOutputFolder" value="${config.imageOutputFolder}" />

instead of

<property name="imageFolder" value="/path/to/dir1" />
<property name开发者_StackOverflow中文版="rawImageFolder" value="/path/to/dir2" />
<property name="imageOutputFolder" value="/path/to/dir3" />


Use the PropertyPlaceholderConfigurer mechanism:

<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
    <property name="locations">
        <!-- change this to your property location -->
        <value>classpath:quartz.properties</value>
    </property>
</bean>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜