I am using Struts2 in an application. I need to download excel file(.xlsx and .xls formats). This is working properly in IE but in Chrome it is showing error
"Duplicate headers received from server"
I use quotes before the file name("<File Name"). Still it is not working in chrome. Below is the code snippets used in my application.
struts.xml
<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>
I have mentioned the content-disposition in the action class as
static final private String Content = "Content-Disposition";
HttpServletResponse response = this.getHttpResponse();
response.setHeader(Content, "attachment;filename='Export.xlsx';");