报错:
Can not find a java.io.InputStream with the name
。。主要代码:public InputStream getInputStream() throws Exception {
return ServletActionContext.getServletContext().getResourceAsStream("/WEB-INF/" + this.fileName);
}<struts>
<package name="default" extends="struts-default">
<action name="download" class="com.DownloadAction"> <result type="stream">
<!--
<param name="directory">D:/download/</param> -->
<param name="contentType">application/octet-stream</param>
<param name="inputName">inputStream</param>
<param name="contentDisposition">attachment;filename="${fileName}"</param>
<param name="bufferSize">4096</param>
</result> </action>访问路径。。
http://192.168.0.52:8080/XT/download.action?filename=qq.txt有关struts2下载的,指导下
Can not find a java.io.InputStream with the name
。。主要代码:public InputStream getInputStream() throws Exception {
return ServletActionContext.getServletContext().getResourceAsStream("/WEB-INF/" + this.fileName);
}<struts>
<package name="default" extends="struts-default">
<action name="download" class="com.DownloadAction"> <result type="stream">
<!--
<param name="directory">D:/download/</param> -->
<param name="contentType">application/octet-stream</param>
<param name="inputName">inputStream</param>
<param name="contentDisposition">attachment;filename="${fileName}"</param>
<param name="bufferSize">4096</param>
</result> </action>访问路径。。
http://192.168.0.52:8080/XT/download.action?filename=qq.txt有关struts2下载的,指导下
你看看你的/WEB-INF/路径下有这个文件吗?--------------
你的qq.txt路径是?
下载就一个response就够了,
如果是非文本文件,response都不需要,一个链接搞定!