WebObjects/Project WONDER/Frameworks/ExcelGeneration
外观
您需要覆盖页面上的appendToResponse,并使其类似于
public void appendToResponse(WOResponse response, WOContext context) { super.appendToResponse(response, context); if(reportData != null) { response.setContent(reportData); reportData = null; String fileName = "results.xls"; response.setHeader("inline; filename=\"" + fileName + "\"", "content-disposition"); response.setHeader("application/vnd.ms-excel", "content-type"); enableExcel = false; } }