struts2下载文件时严重: Can not find a java.io.InputStream with the name [targetFile] in the invocation
2012-05-01 17:56
951 查看
错在这个方法上: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
下载了三次,自然就有三个咯~~~
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 [inputStream] in the invocation stack
- Struts2中下载项目路径以外的文件报错 Can not find a Java.io.InputStream with the name [downloadFile] in the invoc
- struts2文件下载出现Can not find a java.io.InputStream with the name [imageStream] in the invocation stack.
- Struts2 下载 Can not find a java.io.InputStream with the name [downloadFile] in the invocation stack
- struts2文件的下载,Can not find a java.io.InputStream with the name [inputStream] in the invocation stack. Check the tag specified
- 【struts2文件下载】Can not find a java.io.InputStream with the name [downloadFile]...
- (文件下载)Can not find a java.io.InputStream with the name [inputStream] in the invocation stack
- SSH 文件下载发生异常: Can not find a java.io.InputStream with the name [inputStream] in the invocation sta
- Can not find a java.io.InputStream with the name [targetFile] in the invocation stack.
- 下载文件或图片出错,显示Can not find a java.io.InputStream with the name [inputStream] in the invocation
- strut2下载时候的一种异常 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的错误
- struts2文件下载出现Can not find a java.io.InputStream with the name的错误
- 遇到问题----struts2文件下载出现Can not find a java.io.InputStream with the name的错误
- 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问题解决
- struts2下载文件错误信息java.lang.IllegalArgumentException: 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.
- struts2文件下载出现Can not find a java.io.InputStream with the name的错误
- struts2文件下载出现Can not find a java.io.InputStream with the name的错误