Spring Freemarker 相关问题
private Configuration conf;
public void setFreeMarkerConfigurer(
FreeMarkerConfigurer freeMarkerConfigurer) {
//spring的FreeMarkerConfigurer
this.conf = freeMarkerConfigurer.getConfiguration();
}
@Transactional(readOnly = true)
public void index(CmsSite site, String tpl, Map<String, Object> data)
throws IOException, TemplateException {
long time = System.currentTimeMillis();
File f = new File(getIndexPath(site));
File parent = f.getParentFile();
if (!parent.exists()) {
parent.mkdirs();
}
Writer out = null;
try {
out = new OutputStreamWriter(new FileOutputStream(f), UTF8);
Template template = conf.getTemplate(tpl);
template.process(data, out);
} finally {
if (out != null) {
out.flush();
out.close();
}
}
time = System.currentTimeMillis() - time;
log.info("create index page, in {} ms", time);
}
我想知道在哪注入freemarker实例了。类文件里没有。 配置文件中也没有找到。
请知道的朋友告诉一下这个是怎么配置的,谢谢。 如果有相关的资料就更好了。 感谢!
...全文
相关推荐
Spring 使用Freemarker发送邮件的一个简单模板(代码不完整)
NULL 博文链接:https://kanpiaoxue.iteye.com/blog/2176342
spring整合freemarker发送邮件例子
spring整合freemarker实现发送邮件, html中内嵌图片,添加附件, 解决乱码问题.
FreeMarker整合Spring_3
本资源实现了Freemarker 和spring3整合,对Freemarker或者spring的初学者都是很有好处的
spring boot mybatis freemarker整合项目
spring boot mybatis freemarker整合项目的完整源码。最新版本IDEA,稳!
Spring+Freemarker 使用163发HTML格式的邮件
NULL 博文链接:https://chaoyi.iteye.com/blog/2171159


