错误框的提示:
名为“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;
}坐等大侠帮助解答,十万火急
解决方案 »
- 求教大哥们 我我我我我我我我 Java调用bat 为什么不能执行
- JTree中对结点编辑后如何能获得这个结点编辑后的名字?
- why ?
- 在JSP中使用contentType="application/vnd.ms-excel输出内容时如何设定Excel的表单名称(如将Sheet1改为"test")
- 哪位高人帮忙看看我的代码哪里出错了?万分感谢!!!
- String变量是不是不能更改其内部的具体部分,而可以整体被赋值、修改?
- 谁有jxl包呀?急用!可以发给我吗?
- 帮帮啊~我的JCreator pro是不是ClassPath环境变量有问题 ?
- xsl和xml结合怎样换行 求救
- 怎么制作应用程序的帮助文档,并在应用程序里面调出该文档?
- 线程中关于thread和runnable细节
- 刚刚入门的菜鸟求教
但是错误提示 请求路径成了文件名,有点奇怪了,高手快来啊