struts2下载中文文件名称
在action对文件名进行转码,转码成ISO8859-1 然后配置文件里可以这样写
<action name="downloadFile" method="downloadFile"><result name="success" type="stream"><param name="contentType">${userFile.contentType},charset=ISO8859-1</param><param name="inputName">fileInputStream</param><param name="contentDisposition">attachment;filename="${userFile.filename}"</param><param name="bufferSize">1024</param></result><result name="input">/pages/downloadResult.jsp</result><result name="error">/pages/downloadResult.jsp</result></action>