context.put(Context.KEYS, get("keys"));
context.put(Context.TITLES, get("titles"));
context.put(Context.EXTRACTOR, getPropertyExtractor());
HttpServletResponse response = ServletActionContext.getResponse();
Exporter exporter = buildExporter(context);
exporter.getWriter().setOutputStream(response.getOutputStream());
configExporter(exporter, context);
if (format.equals(TransferFormats.XLS)) {
response.setContentType("application/vnd.ms-excel;charset=GBK");
} else {
response.setContentType("application/x-msdownload");
}
response.setHeader(
"Content-Disposition",
"attachment;filename="
+ encodeAttachName(ServletActionContext.getRequest(), fileName + "."
+ format));
// 进行输出
exporter.setContext(context);
exporter.transfer(new TransferResult());
return null;
}