struts2做EXCEL输出时,文件名默认为action的name名称了. 5
果断上代码,struts配置文件如下:<actionname="view001ExcelOutput"class="com.fujitsu.peacenx.deptman...
果断上代码,struts配置文件如下:
<action name="view001ExcelOutput"
class="com.fujitsu.peacenx.deptmanage.view001.action.ProcessMaintAction"
method="excelOutput">
<!-- <result name="success">/jsp/deptmanage/view001.jsp</result> -->
<result name="success" type="stream">
<param name="contentType">
application/vnd.ms-excel
</param>
<param name="inputName">excelStream</param>
<param name="contentDisposition">
attachment;filename="${printFilename}"
</param>
<param name="bufferSize">1024</param>
</result>
<result name="error">/jsp/common/Error.jsp</result>
<interceptor-ref name="vInterceptor"></interceptor-ref>
<interceptor-ref name="defaultStack"></interceptor-ref>
</action>
在火狐上都能正常输出文件名,用IE10测试就成了struts的name名称(view001ExcelOutput)了
!!!
请求支援.! 展开
<action name="view001ExcelOutput"
class="com.fujitsu.peacenx.deptmanage.view001.action.ProcessMaintAction"
method="excelOutput">
<!-- <result name="success">/jsp/deptmanage/view001.jsp</result> -->
<result name="success" type="stream">
<param name="contentType">
application/vnd.ms-excel
</param>
<param name="inputName">excelStream</param>
<param name="contentDisposition">
attachment;filename="${printFilename}"
</param>
<param name="bufferSize">1024</param>
</result>
<result name="error">/jsp/common/Error.jsp</result>
<interceptor-ref name="vInterceptor"></interceptor-ref>
<interceptor-ref name="defaultStack"></interceptor-ref>
</action>
在火狐上都能正常输出文件名,用IE10测试就成了struts的name名称(view001ExcelOutput)了
!!!
请求支援.! 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询