public static Environment renderTemplate(Template template,Map<String,Object> context,Appendable outWriter) throws TemplateException, IOException {
  Environment savedEnv=threadEnv.get();
  threadEnv.set(null);
  try {
    context.remove("null");
    Environment env=template.createProcessingEnvironment(context,(Writer)outWriter);
    applyUserSettings(env,context);
    env.process();
    return env;
  }
  finally {
    threadEnv.set(savedEnv);
  }
}

public static Environment renderTemplate ( Template template , Map < String , Object > context , Appendable outWriter ) throws TemplateException , IOException { Environment savedEnv = threadEnv . get ( ) ; threadEnv . set ( null ) ; try { context . remove ( "null" ) ; Environment env = template . createProcessingEnvironment ( context , ( Writer ) outWriter ) ; applyUserSettings ( env , context ) ; env . process ( ) ; return env ; } finally { threadEnv . set ( savedEnv ) ; } }
renders a template instance .
