下载 文件名 汉字 乱码 解决方案

       <action name="fileDownload" class="repTemplateALO" method="fileDownload" >
           <result name="success" type="stream">
                <param name="encode">true</param>
                <param name="contentType">application/vnd.ms-excel</param>
                <param name="inputName">downloadFile</param> 
                <param name="bufferSize">5242880</param>
                <param name="contentDisposition">attachment;filename="${fileName}"</param>   
            </result>
        </action>

 

查看源码,发现最为简单有效的处理方式,见红字!

 

经测试,UTF-8下可用,对于GBK,GB2312等应该也没问题,但尚未测试证实

你可能感兴趣的:(Excel)