@Override public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { this.applicationContext=applicationContext; ve = new VelocityEngine(); ve.setProperty(Velocity.RESOURCE_LOADER, "class"); ve.setProperty("class.resource.loader.class","org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader"); ve.setProperty(RuntimeConstants.RUNTIME_LOG_LOGSYSTEM,new NullLogChute()); ve.init(); } }
@Override public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { this.applicationContext=applicationContext; ve = new VelocityEngine(); ve.setProperty(Velocity.RESOURCE_LOADER, "class"); ve.setProperty("class.resource.loader.class","org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader"); ve.setProperty(RuntimeConstants.RUNTIME_LOG_LOGSYSTEM,new NullLogChute()); ve.init(); } }
@Override public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { this.applicationContext=applicationContext; ve = new VelocityEngine(); ve.setProperty(Velocity.RESOURCE_LOADER, "class"); ve.setProperty("class.resource.loader.class","org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader"); ve.setProperty(RuntimeConstants.RUNTIME_LOG_LOGSYSTEM,new NullLogChute()); ve.init(); } }
private static VelocityEngine newVelocityEngine() { VelocityEngine engine = new VelocityEngine(); engine.setProperty(RuntimeConstants.RUNTIME_LOG_LOGSYSTEM, new NullLogChute()); engine.setProperty(RuntimeConstants.INPUT_ENCODING, CharsetToolkit.UTF8); engine.setProperty(RuntimeConstants.PARSER_POOL_SIZE, 3); engine.setProperty(RuntimeConstants.RESOURCE_LOADER, "includes"); engine.init(); return engine; }
ve.setProperty(VelocityEngine.RUNTIME_LOG_LOGSYSTEM, new NullLogChute()); ve.init();
public VelocitySQLTemplateProcessor() { this.renderingUtils = new SQLTemplateRenderingUtils(); this.velocityRuntime = new RuntimeInstance(); // set null logger velocityRuntime.addProperty(RuntimeConstants.RUNTIME_LOG_LOGSYSTEM, new NullLogChute()); velocityRuntime .addProperty(RuntimeConstants.RESOURCE_MANAGER_CLASS, SQLTemplateResourceManager.class.getName()); velocityRuntime.addProperty("userdirective", BindDirective.class.getName()); velocityRuntime.addProperty("userdirective", BindEqualDirective.class.getName()); velocityRuntime.addProperty("userdirective", BindNotEqualDirective.class.getName()); velocityRuntime.addProperty("userdirective", BindObjectEqualDirective.class.getName()); velocityRuntime.addProperty("userdirective", BindObjectNotEqualDirective.class.getName()); velocityRuntime.addProperty("userdirective", ResultDirective.class.getName()); velocityRuntime.addProperty("userdirective", ChainDirective.class.getName()); velocityRuntime.addProperty("userdirective", ChunkDirective.class.getName()); try { velocityRuntime.init(); } catch (Exception ex) { throw new CayenneRuntimeException("Error setting up Velocity RuntimeInstance.", ex); } }