错误框的提示:
名为“directview.action”的文档已经打开,不能同时打开同名文件,无论他们是否在同一文件夹中
要打开第二份文档,请关闭已经打开的文档,或者重新命名其中的一个文档。struts2的配置:
<action name="directview" class="directviewAction">
<result type="stream">
<param name="contentType">application/octet-stream;charset=ISO-8859-1</param>
<param name="contentDisposition">inline;filename="${downloadFileName}"</param>
<param name="inputName">downloadFile</param>
<param name="bufferSize">4096</param>
</result>
</action>action代码:
public InputStream getDownloadFile() throws FileNotFoundException {
if (url != null && "yes".equals(url)) {
setEncodeFilePath();
setEncodeFileName();
}
return new FileInputStream(new File(filePath));
}
public String getDownloadFileName() {
String downFileName = fileName;
try {
downFileName = new String(downFileName.getBytes(), "ISO-8859-1"); } catch (UnsupportedEncodingException e) { e.printStackTrace();
}
return downFileName;
}坐等大侠帮助解答,十万火急
名为“directview.action”的文档已经打开,不能同时打开同名文件,无论他们是否在同一文件夹中
要打开第二份文档,请关闭已经打开的文档,或者重新命名其中的一个文档。struts2的配置:
<action name="directview" class="directviewAction">
<result type="stream">
<param name="contentType">application/octet-stream;charset=ISO-8859-1</param>
<param name="contentDisposition">inline;filename="${downloadFileName}"</param>
<param name="inputName">downloadFile</param>
<param name="bufferSize">4096</param>
</result>
</action>action代码:
public InputStream getDownloadFile() throws FileNotFoundException {
if (url != null && "yes".equals(url)) {
setEncodeFilePath();
setEncodeFileName();
}
return new FileInputStream(new File(filePath));
}
public String getDownloadFileName() {
String downFileName = fileName;
try {
downFileName = new String(downFileName.getBytes(), "ISO-8859-1"); } catch (UnsupportedEncodingException e) { e.printStackTrace();
}
return downFileName;
}坐等大侠帮助解答,十万火急
但是错误提示 请求路径成了文件名,有点奇怪了,高手快来啊