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();