Skip to content

Instantly share code, notes, and snippets.

@wspeirs
Created January 20, 2013 17:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wspeirs/4579933 to your computer and use it in GitHub Desktop.
Save wspeirs/4579933 to your computer and use it in GitHub Desktop.
Configuring the Velocity engine
// create the velocity engine
final VelocityEngine velocity = new VelocityEngine();
// set the logger to our Log4J root logger
velocity.setProperty("runtime.log.logsystem.log4j.logger", "root");
// use the resource loader as it's easy with Maven's path setup
velocity.setProperty(RuntimeConstants.RESOURCE_LOADER, "classpath");
velocity.setProperty("classpath.resource.loader.class", ClasspathResourceLoader.class.getName());
// make sure to call init before using the engine
velocity.init();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment