Originally posted by Jeroen Wenting:
You can't push the data from the server to the client so you'll have to wait.
Only alternative would be to have the user enter an email address and use JavaMail to send them the PDF as an email attachment.
He means to say that you can't send the response without any request. So, either the user will have to wait for the response after placing the request or a
thread can be spawned at server side that runs asynchronously and composes the PDF file and then send this file through email which can be taken as a input parameter from the user. In the later case, the user will not have to wait for the time that is used in composing the PDF as that task has been delegated asynchronously to an independent thread.