经过@JFinal指导,代码减少了多
Engine engine = Engine.use().setBaseTemplatePath(PathKit.getWebRootPath()+"/templates/jango"); FileWriter fw=new FileWriter(PathKit.getWebRootPath()+"/index.html",false); engine.getTemplate("/index.html").render(null,fw); fw.flush(); fw.close();
好了,可以用来做CMS的生成静态页了