Spring Freemarker 相关问题

imxjs2011a 2011-06-17 03:24:17

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实例了。类文件里没有。 配置文件中也没有找到。
请知道的朋友告诉一下这个是怎么配置的,谢谢。 如果有相关的资料就更好了。 感谢!
...全文
68 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
不知道楼主是什么意思?freemaker好像不用配置文件吧
zzh200411 2011-06-17
  • 打赏
  • 举报
回复
+1+1+1+1+1

67,512

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧