Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

9
  • 2
    You only have implemented the doGet for your servlet, not the doPost. Commented Oct 13, 2013 at 13:32
  • One more thing: you can't trigger file download using ajax. Imagine a malicious server that start downloading files and applications into your computer without your permission. Commented Oct 13, 2013 at 13:34
  • Yes I know, the problem is that when I change doGet to doPost I can't download the file anymore (ahref won't work). I don't want to trigger file download, I just want to trigger ExportServlet to create a file with ajax. Then when you click on the download file link, It will download the created file. Commented Oct 13, 2013 at 13:36
  • Please read my second comment. Commented Oct 13, 2013 at 13:37
  • C'mon buddy, in ajax you request the data with POST method, while you just implemented the GET method in servlet. so you own me a coffee :D Commented Oct 13, 2013 at 13:38