我正在配置一个Spring任务调度器。jndi的弹簧任务调度器延迟
<task:scheduled-tasks scheduler="myScheduler">
<task:scheduled ref="servicesConfigurationBean" method="loadResources" fixed-delay="300000" />
</task:scheduled-tasks>
它工作正常。现在我想从JNDI查找中设置延迟值。所以,我试过如下:
<task:scheduled ref="servicesConfigurationBean" method="loadResources">
<property name="fixed-delay"><ref local="servicesRefreshRate"/></property>
</task:scheduled>
但现在我得到以下异常:
[/WEB-INF/spring/applicationContext.xml]是无效的;嵌套异常是org.xml.sax.SAXParseException:cvc-complex-type.2.1:元素'task:scheduled'必须没有字符或元素信息项[children],因为该类型的内容类型是空的[/ WEB-INF /spring/applicationContext.xml]无效;嵌套异常是org.xml.sax.SAXParseException:cvc-complex-type.2.1:元素'task:scheduled'必须没有字符或元素信息项[children],因为该类型的内容类型为空。
我明白异常的原因,那么,我的问题是否存在可行的解决方案? 谢谢。
谢谢,我不知道SpEL,但它正是我所期待的。现在是适当的RTFM的时候了。 :) – Carlo 2012-03-07 13:29:38