JSF2和带有命令按钮的文件下载-最终重定向有问题吗?

JSF2和带有命令按钮的文件下载-最终重定向有问题吗?,jsf,download,firebug,Jsf,Download,Firebug,我希望能够在我的JSF应用程序中下载.txt文件。我使用h:命令按钮的方式如下: <h:commandButton value="Download" actionListener="#{exportBean.downloadFile}"> <f:attribute name="fileName" value="#{upload.name}"/> </h:commandButton> 我在backingbean中使用了这种方法:(该实现可能还可以,因为服务

我希望能够在我的JSF应用程序中下载.txt文件。我使用h:命令按钮的方式如下:

<h:commandButton value="Download" actionListener="#{exportBean.downloadFile}">
<f:attribute name="fileName" value="#{upload.name}"/>
</h:commandButton>

我在backingbean中使用了这种方法:(该实现可能还可以,因为服务器返回了我想要下载的文件——可以在firebug输出中看到,只有当您感兴趣时,我才会粘贴它)

我的问题是,当我“点击”h:commandButton下载文件时,并没有保存或打开文件的对话框窗口。。。有人知道问题出在哪里吗


这是我的firebug输出:

您可能希望在中替换AJAX
actionListener

<h:commandButton value="Delete file" actionListener="#{exportBean.deleteFile}">

托管bean的作用域是什么?您是否尝试过不使用java NIO(只是为了交叉检查)并关闭inputstream/outputstream(src,dest)作用域为@CustomScope(value=“#{window}”)…它是来自IceFaces的特殊类型。
<h:commandButton value="Delete file" action="#{exportBean.deleteFile}">