记录以流的形式导出EXCEL跨域问题,项目中其他功能不跨域

 fileName = new String(fileName.getBytes(),"ISO8859-1");

            OutputStream ouputStream = response.getOutputStream();

response.setHeader("Access-Control-Expose-Headers", "Content-Disposition");
            response.setHeader("Pragma", "no-cache");
            response.setHeader("Cache-Control", "no-cache");
            response.setHeader("Content-Type","application/force-download");
            response.setHeader("Content-Type","application/vnd.ms-excel");
            response.setHeader("Content-Disposition", "attachment;filename="+ fileName +".xls");

wb.write(ouputStream);
            ouputStream.flush();
            ouputStream.close();


版权声明:本文为qq_32512945原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。