So when I get it right, it is a "huge" difference if the request is issued sort of "by hand" using browser mechanisms like Links or programmatic "paste of URLs" by opening a new browser window or IFrame with a given URL COMPARED TO programmatic issued requests using GWT rpc and/or RequestBuilder. I always thought that in the end these were the same mechanisms.
I regard this as a limitation to me as a developer. Of course people click OK without noticing it but in my case people would click "Export As..." before clicking that "dangerous" OK button ... :-/ Anyway thank you very much for this information. I will have to stick to other well known techniques issuing requests by URL also mentioned above. On 27 Mai, 17:36, Sripathi Krishnan <sripathi.krish...@gmail.com> wrote: > > The point I do not get about this is why the browser does not react to the > > content disposition by downloading the file and instead passing the > > response back to the ajax-world... <snip> ... I read a lot about that doing > > what i would like to do is not possible but no one really said why. > > Browsers don't allow it because it is a major security issue. If it were > possible, websites would start delivering malware using these mechanisms. > Many people are stupid to just click okay. > > There is no way to automatically trigger a file download in a browser. File > download can only begin when the user explicitly takes an action - such as > clicking on a link. > > --Sri > > On 27 May 2010 19:47, andreas <horst.andrea...@googlemail.com> wrote: > > > > > Hi, > > > I'm trying to trigger a download via GWT rpc and/or GWT > > RequestBuilder. The motivation of using rpc and/or RequestBuilder is > > the ability to send data required for the on-the-fly generated > > download files that way. > > > I already managed to modify the underlying request by using > > RequestBuilder as return value of the rpc service method. The request > > is routed to a HttpServlet implementing the doPost method. GWT utility > > classes are used to obtain the RPCRequest instance and the given > > parameters of the rpc service call successfully out of the > > HttpRequest. After using the parameters and assembling the file on the > > servlet in the doPost method the HttpResponse instance is used to > > write that file. Headers 'content-disposition' and 'content-type' are > > set accordingly to trigger a download in the browser. > > > However a download does not start. The response is accessible in the > > RequestCallback instance assigned to the request. The point I do not > > get about this is why the browser does not react to the content > > disposition by downloading the file and instead passing the response > > back to the ajax-world. I know that the rpc or request would fail > > otherwise but that would be perfectly fine, since no response is > > desired but a download. > > > Related posts: > > >http://groups.google.com/group/google-web-toolkit/browse_thread/threa... > > >http://groups.google.com/group/google-web-toolkit/browse_thread/threa... > > > I know that there are solutions with backposts and passing data via > > parameters in the request url, but i would love to just stick to one > > mechanism which is GWT rpc. I read a lot about that doing what i would > > like to do is not possible but no one really said why. I especially > > wonder why the browser does not do its thing since it is surely the > > one that gets the response before the ajax code doesn't he? > > > I would like to hear about other solutions and if possible about why > > exactly it is not possible to trigger download via GWT rpc. After all > > escaping the GWT rpc mechanism on the server side works fine but on > > the browser side not. Any ideas? > > > Greetings, > > Andreas > > > -- > > You received this message because you are subscribed to the Google Groups > > "Google Web Toolkit" group. > > To post to this group, send email to google-web-tool...@googlegroups.com. > > To unsubscribe from this group, send email to > > google-web-toolkit+unsubscr...@googlegroups.com<google-web-toolkit%2Bunsubs > > cr...@googlegroups.com> > > . > > For more options, visit this group at > >http://groups.google.com/group/google-web-toolkit?hl=en. -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.