<分区>
我在应用程序中使用 Struts2。我需要下载 excel 文件(.xlsx 和 .xls 格式)。这在 IE 中工作正常,但在 Chrome 中显示错误
"Duplicate headers received from server"
我在文件名前使用引号 (" struts.xml 我已经在 Action 类中提到了内容配置<action name="*Excel" method="{1}" class="ReportUtilityAction">
<result name="success" type="stream">
<param name="contentType">application/vnd.ms-excel</param>
<param name="inputName">fileInputStream</param>
<param name="bufferSize">1024</param>
</result>
</action>
static final private String Content = "Content-Disposition";
HttpServletResponse response = this.getHttpResponse();
response.setHeader(Content, "attachment;filename='Export.xlsx';");