javaweb中通过POI生成Excel并弹出下载窗口!

2025-03-25 12:40:05
推荐回答(1个)
回答1:

把response的输出类型设置成
response.setContentType("application/x-download
response.addHeader("Content-Disposition","attachment;filename=myexcel.xls" );

POI结果直接给response的输出流,就可以了