public void writeTo(String templateName, TemplateContext context, OutputStream ostream) throws TemplateException,
IOException {
TemplateMatchResult result = findTemplate(templateName);
TemplateEngine engine = assertNotNull(result.getEngine(), "templateEngine");
engine.writeTo(result.getTemplateName(), context, ostream);
}
/** 渲染模板,并将渲染的结果送到字符输出流中。 */
public void writeTo(String templateName, TemplateContext context, Writer writer) throws TemplateException,
IOException {