首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

java生成FTL资料

2012-12-21 
java生成FTL文件java生成FTL文件核心代码:String path ServletActionContext.getServletContext().getRe

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

热点排行