日期:2014-05-18 浏览次数:20682 次
@Results({ @Result(name = "csv", type = "stream", params = { "contentType", "text/plain", "contentDisposition",
"attachment;fileName=\"${fileName}\"", "inputName", "downloadFile", "bufferSize", "1024" }), })
public class Kaigaigw060Action extends KaigaiActionSupport implements ServletRequestAware {
public String createCsv() throws Exception {
csv文件生成代码。。。省略
return "csv";
}
public InputStream getDownloadFile() throws Exception {
String path = XXXXXXX;
FileInputStream stream = new FileInputStream(path);
File csvFile = new File(path);
if (csvFile.exists()) {
csvFile.delete();
}
return stream;
}
}