速度模板自动重新加载不起作用 [英] Velocity Template auto-reload doesn't work
本文介绍了速度模板自动重新加载不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在更改速度模板后重新加载它.为此,我进行了以下设置,但是当我手动更改META-INF/template/
内的.vm文件时,重新加载不起作用.
I want to reload velocity template as it's changed. For this I've set the followings, but reload doesn't work when I manually change a .vm file inside META-INF/template/
.
velocimacro.library.autoreload = true
[spring|file|class].resource.loader.cache = false
有什么主意吗?这是我的velocityEngine bean
Any idea? Here is my velocityEngine bean
<bean id="velocityEngine" class="org.springframework.ui.velocity.VelocityEngineFactoryBean">
<property name="resourceLoaderPath" value="classpath:META-INF/template/" />
<property name="preferFileSystemAccess" value="false" />
<property name="velocityProperties">
<props>
<prop key="spring.resource.loader.cache">false</prop>
<prop key="file.resource.loader.cache">false</prop>
<prop key="class.resource.loader.cache">false</prop>
<prop key="velocimacro.library.autoreload">true</prop>
<prop key="resource.loader">spring</prop>
<prop key="directive.foreach.counter.name">counter</prop>
<prop key="directive.foreach.counter.initial.value">0</prop>
<prop key="spring.resource.loader.class">
org.springframework.ui.velocity.SpringResourceLoader
</prop>
</props>
</property>
</bean>
推荐答案
查看全文