0

我希望能够在我的 JSF 应用程序中下载 .txt 文件。我这样使用 h:command 按钮:

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

我在支持 bean 中使用此方法:http: //pastebin.com/BMAQSgTJ(该实现可能没问题,因为服务器返回我要下载的文件 - 可以在 firebug 输出中看到,我只粘贴它如果你是感兴趣的)

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

这是我的萤火虫输出:http ://dl.dropbox.com/u/21435926/firebug.png

4

1 回答 1

1

You might want to replace the AJAX actionListener in

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

to an action:

<h:commandButton value="Delete file" action="#{exportBean.deleteFile}">
于 2012-04-06T15:02:16.757 回答