Skip to content

Instantly share code, notes, and snippets.

@kohsuke
Created April 13, 2012 23:43
Show Gist options
  • Select an option

  • Save kohsuke/2381018 to your computer and use it in GitHub Desktop.

Select an option

Save kohsuke/2381018 to your computer and use it in GitHub Desktop.
ClassLoader old = Thread.currentThread().getContextClassLoader();
Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
try {
... call into Velocity ...
} finally {
Thread.currentThread().setContextClassLoader(old);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment