-
Bug
-
Resolution: Cannot Reproduce
-
Medium
-
None
-
2.10.1
VelocityUtils uses the Confluence ClassLoader, so Velocity templates inside the plugin aren't visible to it.
We need to document a workaround for this. One possible one is loading the resource manually:
public void execute(Map params, String body, RenderContext renderContext) { // ... create context InputStream template = getClass().getClassLoader().getResourceAsStream("path/to/template.vm"); return VelocityUtils.getRenderedContent(IOUtils.toString(template), context); }
We should probably wrap this in some kind of helper for plugins though.