File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Spring and the fly likes How to turn off the caching in Velocity Engine system? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "How to turn off the caching in Velocity Engine system?" Watch "How to turn off the caching in Velocity Engine system?" New topic
Author

How to turn off the caching in Velocity Engine system?

Guy Roth
Ranch Hand

Joined: Aug 09, 2009
Posts: 74
I am using Spring's Velocity Engine (org.springframework.ui.velocity.VelocityEngineFactoryBean)
The problem is that by default the velocity engine is caching the macros that are defined by this engine so in order to refresh the macro definitions I have to restart the Velocity Engine
Is there any way to disable the caching of the macro?

I tried this: velocityProperties.put("file.resource.loader.cache","false");
but it didn't help.
I also so this link that didn't solve this problem: http://forum.springsource.org/showthread.php?t=16740

Anyone?
Guy Roth
Ranch Hand

Joined: Aug 09, 2009
Posts: 74
Just to update my question:
I tried the following:

and also to perform

before every time that I do engine.evaluate()...
But the Velocity engine still after all this remember that previous definitions of its macro and doesn't replace them!!!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to turn off the caching in Velocity Engine system?
 
Similar Threads
Velocity + jasper report
How to speed up template engine
Auto generate the repository creation scripts for different databases by using VTL
Velocity macro question -- How to create the password input field in the .VM file
Convert Java Array to JavaScript Array.