No result defined for action action.FileDownLoadAction and result downSuccess

来源:4-5 通过Struts2实现文件下载

ParaPeng

2017-02-04 13:49

        <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

写回答 关注

2回答

  • ParaPeng
    2017-02-04 15:42:01

    然后还有一个问题是  如果namespace不为根目录的话 比如="/model/other"  一定要在

    <a  href="<%=path%>/model/other/FileDownLoad"/>中加入全路径 

    否则一直报

    No result defined for action action.FileDownLoadAction and result downSuccess


  • ParaPeng
    2017-02-04 14:11:50

    找到了问题  控制台输出了

    Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 3986

    tomcat8.5的问题 添加了一些验证

    原因是在url中传递中文导致的


    奈戈岚勒 回复奈戈岚勒

    写错了,低版本的tomcat么?

    2017-02-09 16:58:42

    共 2 条回复 >

Java中的文件上传下载

由简入深,轻松实现文件上传下载功能及相关框架的使用

77397 学习 · 337 问题

查看课程

相似问题