[英]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. 我在基于Java的Webapp中使用spring 2.0.6和quartz 1.5.2。 Want to know how to configure my applicationContext-quartz.xml such that i can read values from a properties file. 想知道如何配置我的applicationContext-quartz.xml,以便我可以从属性文件中读取值。 ie 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="rawImageFolder" value="/path/to/dir2" />
<property name="imageOutputFolder" value="/path/to/dir3" />
Use the PropertyPlaceholderConfigurer
mechanism : 使用PropertyPlaceholderConfigurer
机制 :
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<!-- change this to your property location -->
<value>classpath:quartz.properties</value>
</property>
</bean>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.