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下载的,指导下
[最优解释]