<action name="FileDownLoad_execute" class="action.FileDownLoadAction">
<param name="inputPath">/source/${downloadName}</param>
<result name="downSuccess" type="stream">
<param name="contentType">application/octet-stream</param>
<param name="inputName">inputStream</param>
<param name="contentDisposition">attachment;filename="${downloadName}"</param>
<param name="bufferSize">8192</param>
</result>
</action>
明明配置了啊 struts 用的2.3.3
然后还有一个问题是 如果namespace不为根目录的话 比如="/model/other" 一定要在
<a href="<%=path%>/model/other/FileDownLoad"/>中加入全路径
否则一直报
No result defined for action action.FileDownLoadAction and result downSuccess
找到了问题 控制台输出了
Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 3986
tomcat8.5的问题 添加了一些验证
原因是在url中传递中文导致的