如何将文件从服务器端下载到HD

问题描述:

我生成了一个pdf文件,现在它在服务器上现在有什么方法可以将它下载到我的桌​​面上吗?如何将文件从服务器端下载到HD

我在客户端使用smartGWT,在服务器端使用java。

+0

http://*.com/questions/4020949/how-to-download-a-file-using-分配的文件路径gwt-client – Adi 2013-02-26 12:59:37

+1

这个问题,正如评论所述,已经回答[这里](http://*.com/questions/4020949/how-to-download-a-file-using-gwt-client) – christopher 2013-02-26 13:01:14

写一个Servlet.这是example

然后通过使用下面的代码:

Window.open(GWT.getHostPageBaseURL() 
     + "/PdfDownload?path=filepath, "", ""); 

通过req.getParametr("filepath");