struts2下载文件时严重: Can not find a java.io.InputStream with the name [targetFile] in the invocation
来源:互联网 发布:淘宝买汽枪怎么搜索 编辑:程序博客网 时间:2024/05/17 04:46
错在这个方法上:public InputStream getTargetFile(){//对应上边的文件路径,给出它的输入流,对应在配置文件的InputName属性名
return ServletActionContext.getServletContext().getResourceAsStream(downloadFile);
}
strutts.xml在配置时要:<param name="downloadFile">/小莫.jpg</param> 这个与上面的是对应的
控制台打出值为null如下:
null
2012-5-1 17:49:17 com.opensymphony.xwork2.util.logging.commons.CommonsLogger error严重: Can not find a java.io.InputStream with the name [targetFile] in the invocation
stack. Check the <param name="inputName"> tag specified for this action.
改正后:
控制台打出值为
信息: Server startup in 16424 ms
java.io.ByteArrayInputStream@c1e4d5
java.io.ByteArrayInputStream@119b1ca
java.io.ByteArrayInputStream@98b13b
下载了三次,自然就有三个咯~~~
- struts2下载文件时严重: Can not find a java.io.InputStream with the name [targetFile] in the invocation
- Can not find a java.io.InputStream with the name [targetFile] in the invocation stack.
- (Struts2文件下载)Can not find a java.io.InputStream with the name [inputStream] in the invocation stack
- struts2文件下载出现Can not find a java.io.InputStream with the name [imageStream] in the invocation stack.
- 文件下载Can not find a java.io.InputStream with the name [inputStream] in the invocation stack错误
- (文件下载)Can not find a java.io.InputStream with the name [inputStream] in the invocation stack
- 文件下载Can not find a java.io.InputStream with the name [inputStream] in the invocation stack错误
- 下载文件或图片出错,显示Can not find a java.io.InputStream with the name [inputStream] in the invocation
- SSH 文件下载发生异常: Can not find a java.io.InputStream with the name [inputStream] in the invocation sta
- Struts2 下载 Can not find a java.io.InputStream with the name [downloadFile] in the invocation stack
- Can not find a java.io.InputStream with the name [inputStream] in the invocation stack问题解决
- Can not find a java.io.InputStream with the name [inputStream] in the invocation stack问题解决
- Can not find a java.io.InputStream with the name [inputStream] in the invocation stack
- Can not find a java.io.InputStream with the name [inputStream] in the invocation
- Can not find a java.io.InputStream with the name [inputStream] in the invocation stack
- 通过Struts2文件下载时Can not find a java.io.InputStream with the name 异常
- Can not find a java.io.InputStream with the name [downloadFile] in the invocation stack问题解决
- Can not find a java.io.InputStream with the name [downloadFile] in the invocation stack问题解决
- libevent库源码学习-poll/select( linux)
- Java 并发的初步学习 (Thread的 Runnable Callable 试用)
- 计算机网络Tanenbaum(第四版)笔记
- 建造者模式
- C#问题
- struts2下载文件时严重: Can not find a java.io.InputStream with the name [targetFile] in the invocation
- JAVA 数字图像处理----非白即黑的灰,2B青年的自画像
- C++中的Big Three
- 绑定cpu
- 华为的天花板:企业基因、体能与耐力的大考
- 福布斯:谷歌Facebook五年内或将彻底消失
- 红叹号:XXX cannot be resolved to a variable
- ubuntu12.04安装vmware workstation8后不能运行的解决方法
- LINUX下使用JsonCpp