简体   繁体   English

我如何从石英调度程序的属性文件中获取值?

[英]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.

相关问题 如何在Tomcat中使用spring-style属性文件配置Crystal Scheduler? - How to configure quartz scheduler with spring-style properties file in Tomcat? 如果我不关机石英调度器会怎样? - What happens if I do not shutdown() quartz scheduler 如何获取注册到 Quartz 调度器的触发器列表 - how get a list of Triggers registered to a Quartz scheduler 如何在ServletContextListener中获取对Quartz Scheduler的引用? (支柱2) - How to get a reference to the Quartz Scheduler in ServletContextListener? (struts 2) Maven 配置文件 - 如何获取分配给.properties 文件中的属性的值并将它们分配给我的 class 中的变量? - Maven Profiles - How do i get the values assigned to properties in the .properties file and assign them to variables in my class? 如何构造Quartz调度程序? - How can I construct Quartz scheduler? 如何从Quartz Scheduler查询已调度的作业? - How to query the scheduled jobs from Quartz scheduler? 如何使用属性文件中的值在Spring属性中进行算术运算? - How to do arithmetic in Spring properties, with values from a properties file? Quartz Scheduler没有选择quartz.properties中提到的调度程序 - Quartz Scheduler did not pick the scheduler mentioned in the quartz.properties 如何扩展 Quartz 调度器? - How to scale the Quartz scheduler?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM