Author: ssolsagl
Date: 2007-05-24 10:34:22 +0200 (Thu, 24 May 2007)
New Revision: 5162

Modified:
   
trunk/core-api/src/main/java/no/schibstedsok/searchportal/view/velocity/VelocityEngineFactory.java
Log:
Fix to avoid caching of macroes when running in debug mode.

Modified: 
trunk/core-api/src/main/java/no/schibstedsok/searchportal/view/velocity/VelocityEngineFactory.java
===================================================================
--- 
trunk/core-api/src/main/java/no/schibstedsok/searchportal/view/velocity/VelocityEngineFactory.java
  2007-05-24 07:41:30 UTC (rev 5161)
+++ 
trunk/core-api/src/main/java/no/schibstedsok/searchportal/view/velocity/VelocityEngineFactory.java
  2007-05-24 08:34:22 UTC (rev 5162)
@@ -163,7 +163,11 @@
             INSTANCES_LOCK.readLock().unlock();
         }
 
-        if (instance == null) {
+        if(!VELOCITY_DEBUG) {
+            if (instance == null) {
+                instance = new VelocityEngineFactory(cxt);
+            }
+        } else {
             instance = new VelocityEngineFactory(cxt);
         }
 
@@ -243,7 +247,10 @@
                 engine.setProperty(Velocity.RESOURCE_LOADER, "url");
                 engine.setProperty("url.resource.loader.class", 
URLVelocityTemplateLoader.class.getName());
 
-                if(!VELOCITY_DEBUG) {
+                if(VELOCITY_DEBUG) {
+                    engine.setProperty("url.resource.loader.cache", "false");
+                    engine.setProperty("velocimacro.library.autoreload", 
"true");                    
+                } else {
                        engine.setProperty("url.resource.loader.cache", "true");
                        
engine.setProperty("url.resource.loader.modificationCheckInterval", "60");
                     engine.setProperty(Velocity.RESOURCE_MANAGER_CLASS, 
QuickResourceManagerImpl.class.getName());

_______________________________________________
Kernel-commits mailing list
[email protected]
http://sesat.no/mailman/listinfo/kernel-commits

Reply via email to