While the RPC preps the file(s), I put up a "wait" dialog.
The download is done with a servlet which I direct to a hidden frame.
In my project's HTML I put
<iframe src="javascript:''" id="__gwt_downloadFrame" style="width:
0;height:0;border:0"></iframe>
just below my history frame. In loading my module class is
private static final String DOWNLOAD_IFRAME = "__gwt_downloadFrame";
private static Frame downloadFrame;
which I wrap in onModule load with
// Get the hidden frame that's our download target.
downloadFrame =
Frame.wrap(Document.get().getElementById(DOWNLOAD_IFRAME));
and make available with a static method:
public static void downloadURL(String url) {
downloadFrame.setUrl(url);
}
If the RPC completes properly, I call the download servlet:
String saveURL = GWT.getModuleBaseURL() +
"downloadServlet?..." [params]
MyProject.downloadURL(saveURL);
You may have to do some other hand waving in the servlet to set the
proper headers, esp.with SSL (
http://www.jspwiki.org/wiki/
BugSSLAndIENoCacheBug).