`
wangfeiaini
  • 浏览: 53333 次
  • 性别: Icon_minigender_1
  • 来自: 南京
社区版块
存档分类
最新评论

java生成FTL文件

阅读更多

java生成FTL文件核心代码:String path = ServletActionContext.getServletContext().getRealPath("/cms");

				String templateName = DateUtil.convertDate(new Date(), "").replaceAll("-", "").replaceAll(":", "").replaceAll(" ", "");
				File templatePath = new File(path);
				if(!templatePath.exists()||!templatePath.isDirectory()){
					templatePath.mkdir();
				}
				String tempFlie = templateName+".ftl";
				File templateFile = new File(templatePath,tempFlie);
				FileWriter fw = new FileWriter(templateFile);
				fw.write(sb.toString());
				fw.flush();
				fw.close();
分享到:
评论
1 楼 happydayjet 2014-03-18  
有没有完整一点的例子呢?

相关推荐

Global site tag (gtag.js) - Google Analytics