I am trying to create a PDF file on my server-side and then send it back via the response to be downloaded from the client browser.
What happens, is the following:
1.The user clicks on a button on the jsp, to create/download the pdf.
2. The servlet is called using js (jquery).
3. The PDF file is generated on the server side.
4. I get an alert box (using js) saying 'PDF generation succeeded'.
5. However, I get no download option from Mozzila (nor chrome, nor IE).
Here is the code I use in my doPost servlet method to create and then download the pdf file:
Okay... so that's your servlet code. Doesn't look too bad. But you said your web page was submitting the request via JQuery, didn't you? In which case it's your responsibility to handle the response which is sent back to you. Don't expect the browser to handle it -- the browser doesn't handle the responses for JQuery requests.
Joined: Apr 11, 2011
Thank you for your reply, I will give it a shot with a more 'traditional' non-js way.
Still, does anyone know how I would be able to retrieve the response via jquery/js?