From 64b8b1ab9f95f5d737dd247c82c9864fd52b7892 Mon Sep 17 00:00:00 2001 From: mdb Date: Fri, 26 Nov 2004 22:57:59 +0000 Subject: [PATCH] Initialize velocity in the proper way. git-svn-id: https://samskivert.googlecode.com/svn/trunk@1533 6335cc39-0255-0410-8fd6-9bcaacd3b74c --- .../com/samskivert/velocity/VelocityUtil.java | 20 ++++++++----------- 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/projects/samskivert/src/java/com/samskivert/velocity/VelocityUtil.java b/projects/samskivert/src/java/com/samskivert/velocity/VelocityUtil.java index 7feebe42..f38e1ad0 100644 --- a/projects/samskivert/src/java/com/samskivert/velocity/VelocityUtil.java +++ b/projects/samskivert/src/java/com/samskivert/velocity/VelocityUtil.java @@ -3,8 +3,6 @@ package com.samskivert.velocity; -import java.util.Properties; - import org.apache.velocity.VelocityContext; import org.apache.velocity.app.VelocityEngine; import org.apache.velocity.runtime.RuntimeServices; @@ -30,16 +28,14 @@ public class VelocityUtil throws Exception { // initialize velocity which we'll use for templating - Properties props = new Properties(); - props.put(VelocityEngine.VM_LIBRARY, ""); - props.put(VelocityEngine.RESOURCE_LOADER, "classpath"); - props.put("classpath." + VelocityEngine.RESOURCE_LOADER + ".class", - ClasspathResourceLoader.class.getName()); - VelocityEngine velocity = new VelocityEngine(); - velocity.init(props); - velocity.setProperty( - VelocityEngine.RUNTIME_LOG_LOGSYSTEM, _logger); - return velocity; + VelocityEngine ve = new VelocityEngine(); + ve.setProperty(VelocityEngine.VM_LIBRARY, ""); + ve.setProperty(VelocityEngine.RESOURCE_LOADER, "classpath"); + ve.setProperty("classpath." + VelocityEngine.RESOURCE_LOADER + ".class", + ClasspathResourceLoader.class.getName()); + ve.setProperty(VelocityEngine.RUNTIME_LOG_LOGSYSTEM, _logger); + ve.init(); + return ve; } /** Handles logging for Velocity. */