这个路径生成的文件是在这个路径里么?
@Action(value="makeHtml")
public String makeHtml(){
Map <String,Object>map = new HashMap<String,Object>();
CreateHtml createHtml=new CreateHtml();
String ftl = "article.html";
String relaPath = "Article/";
int count=0;
try {
for (Integer id:ids)
{
String htmlName = id+".html";
Article entity=entityService.find(id);
if(entity!=null&&entity.getCheckState()==CheckState.pass){
map.put("entity",entity);
createHtml.init(ftl, htmlName, map, relaPath);
count++;
}
}
Struts2Utils.setAttribute("message","已在"+relaPath+"目录生成个"+count+"个html文件");
return "succ";
} catch (IOException e) {
e.printStackTrace();
} catch (TemplateException e) {
e.printStackTrace();
}
return ERROR;
}