日期:2014-05-20 浏览次数:20902 次
public class TrainingAttendHistoryExportRegisterAction extends DefaultActionSupport {
private static final long serialVersionUID = 6929180904579405855L;
private String path;
public String getPath() {
return path;
}
public void setPath(String path) {
this.path = path;
}
public InputStream getInputStream() throws Exception {
// 根据配置文件inputPath属性值返回一个文件输入流
OutputStreamWriter fw = new OutputStreamWriter(new FileOutputStream("trainingAttendHistoryExportRegister.html"),"big5");
fw.write("<html></html>"+"\r\n");
fw.close();
InputStream is=new FileInputStream("pa");
// File reDocFile = new File(ServletActionContext.getServletContext().getRealPath("/")+"test.html");
return ServletActionContext.getServletContext().getResourceAsStream(path);
}
public String execute() throws Exception {
return SUCCESS;
}
}