首页 新闻 会员 周边 捐助

关于struts2下载文件inputName找不到对应方法的问题

0
悬赏园豆:20 [待解决问题]

struts2.xml部分代码:

<result name="download_success" type="stream">
  <!-- 下载流 getInputStream -->
  <param name="inputName">${inputStream}</param>
  <param name="contentType">${contentType}</param>
  <!--<param name="contentType">application/octet-stream;charset=ISO8859-1</param>-->
  <param name="contentDisposition">attachment;filename=${downloadFilename}</param>
</result>

action部分代码:

控制台报错:

真实路径/media/leslie/CAD7A9574394273E/upload/5e95c108-b1f3-4809-aa03-e069cbab0157.txt


2017-12-04 22:37:23,103 ERROR [org.apache.struts2.dispatcher.StreamResult] - Can not find a java.io.InputStream with the name [${inputStream}] in the invocation stack. Check the <param name="inputName"> tag specified for this action.


2017-12-04 22:37:42,896 ERROR [org.apache.struts2.dispatcher.Dispatcher] - Exception occurred during processing request: Can not find a java.io.InputStream with the name [${inputStream}] in the invocation stack. Check the <param name="inputName"> tag specified for this action.


java.lang.IllegalArgumentException: Can not find a java.io.InputStream with the name [${inputStream}] in the invocation stack. Check the <param name="inputName"> tag specified for this action.

大热的主页 大热 | 初学一级 | 园豆:182
提问于:2017-12-04 23:02
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册