Results 1 to 3 of 3

Thread: How to turn off caching of velocity templates?

  1. #1
    Join Date
    Dec 2004
    Posts
    8

    Default How to turn off caching of velocity templates?

    Hi. Is it possible to disable caching of velocity templates? Here are the configuration settings i've tried:

    Code:
    <bean id="velocityConfigurer" class="org.springframework.web.servlet.view.velocity.VelocityConfigurer">
        <property name="resourceLoaderPath" value="WEB-INF/views/" />
        <property name="velocityProperties">
            <props>
                <prop key="file.resource.loader.cache">false</prop>
                <prop key="springMacro.resource.loader.cache">false</prop>
                <prop key="velocimacro.library.autoreload">true</prop>
                ...
        </property>
    </bean>
    "springMacro" is the name of the resource loader for the bind macros. "file" is the name of the resource loader VelocityEngineFactory tells the velocity engine to use for templates in resourceLoaderPath if preferFileSystemAccess is true (which is is by default).

    Code:
    <bean id="viewResolver" class="no.bbs.nettbutikk.spring.VelocityToolboxViewResolver">
        <property name="cache" value="false" />
        <property name="exposeSpringMacroHelpers" value="true" />
        <property name="suffix" value=".vm" />
        <property name="contentType" value="text/html; charset=ISO-8859-1" />
        <property name="toolboxConfigLocation" value="/WEB-INF/velocitytoolbox.xml" />
        <property name="requestContextAttribute" value="rc" />
    </bean>
    VelocityToolboxViewResolver is a subclass of org.springframework.web.servlet.view.velocity.Velo cityViewResolver.

    Velocity 1.4, Spring 1.2 rc 1.

  2. #2
    Join Date
    Aug 2004
    Location
    London, UK
    Posts
    339

    Default

    you may need to call
    Code:
    setCacheTemplate&#40;false&#41;;
    on the VelocityView itself.

    Regards,
    Darren Davison.
    Public Key: 0xE855B3EA

  3. #3
    Join Date
    Dec 2004
    Posts
    8

    Default

    Thanks, but it doesn't seem to make any difference.

Similar Threads

  1. FreeMarker vs Velocity
    By Martin Kersten in forum Architecture
    Replies: 8
    Last Post: May 30th, 2005, 09:21 AM
  2. Using Long in velocity templates
    By paul.barry in forum Web
    Replies: 1
    Last Post: May 9th, 2005, 07:34 AM
  3. XSLT view caching multiple Templates
    By jmakeig in forum Web
    Replies: 5
    Last Post: Apr 1st, 2005, 03:09 AM
  4. Velocity templates need help
    By kelvint in forum Web
    Replies: 1
    Last Post: Nov 24th, 2004, 03:21 AM
  5. Replies: 3
    Last Post: Oct 19th, 2004, 09:20 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •