I need to close a popup window after generating a file. The content of the file comes from another application. The popup should be closed after the file is printed, when the streams are closed, but I cannot write anything else in this page because the response has been already commited. Could you give me any ideas?
The process is a little bit confusing, and we are forced to used the other application... I will try to explain the steps clearly:
1. I create the popup where my servlet is going to be executed.
2. The servlet changes the headers and compose the url to call the other application.
3. The servlet reads the results and close the streams. The browser shows the download window.
4. Now the popup is no longer necessary and should be closed, but I can't write in the same page because the response has already been commited.
Any ideas or advices will be appreciated. We are using java5.
Use an AJAX check form the main window to poll for when the download is complete? I'm not clear on why you want to close the child window though. Doesn't it potentially contain a file (depending on user settings.)
After saving the file, the popup window is still there, it appears when line 26 is executed. The popup doesn't contain anything. In fact I don't want this window, but I need it to call the servlet and generate the file without changing the main page.