以下是本人整合SpringMVC+Velocity的一些心得和体会
applicationcontext.xml
<bean id="velocityConfigurer" class="org.springframework.web.servlet.view.velocity.VelocityConfigurer">
<property name="resourceLoaderPath" value="WEB-INF/views/" />
<property name="velocityProperties">
<map>
<entry key="input.encoding" value="${vm.file.encoding}"></entry>
<entry key="output.encoding" value="${web.encoding}"></entry>
<entry key="file.resource.loader.cache" value="${vm.cache}"></entry>
<entry key="file.resource.loader.modificationCheckInterval" value="-1"></entry>
<!-- cache directive 相关配置 -->
<entry key="userdirective" value="com.eyeieye.melody.web.velocity.directive.CacheDirective"></entry>
<!-- direcitive.cache.provider 配置cache的提供者 -->
<entry key="direcitive.cache.provider" value-ref="velocityViewCache"></entry>
<!-- direcitive.cache.close_velocity_cache 控制是否打开cache,如果是true,则关闭 -->
<entry key="direcitive.cache.dev.mode" value="close_velocity_cache"></entry>
</map>
</property>
<property name="configLocation" value