Fix bug in GroovyTemplate convenience

It was ignoring the engine argument in the 3 arg version
of template().
pull/1016/head
Dave Syer 11 years ago
parent b0579c1cf3
commit ed15f742fd

@ -49,15 +49,14 @@ public abstract class GroovyTemplate {
public static String template(TemplateEngine engine, String name, Map<String, ?> model)
throws IOException, CompilationFailedException, ClassNotFoundException {
Writable writable = getTemplate(name).make(model);
Writable writable = getTemplate(engine, name).make(model);
StringWriter result = new StringWriter();
writable.writeTo(result);
return result.toString();
}
private static Template getTemplate(String name) throws CompilationFailedException,
private static Template getTemplate(TemplateEngine engine, String name) throws CompilationFailedException,
ClassNotFoundException, IOException {
GStringTemplateEngine engine = new GStringTemplateEngine();
File file = new File("templates", name);
if (file.exists()) {

Loading…
Cancel
Save