We have a servlet that prints a server side generated Excel file to the response output stream. The Excel file is generated by a single method which returns the complete file in a POI Workbook object.
Our problem is that the method which generates the file lasts almost 30 seconds to execute. The clients keeps waiting for response all this time until we start writing the file to the response.
Is there any way to write "something" in the response to make the client navigator fire the download dialog?
Something like...
response.getOutputStream().write(null);
workbook.write(response.getOutputStream());
(Writing null in an outputStream throws a NullPointerException)
This way the download would seem to have been started although the file would be yet getting generated.