Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Closing servlet window after XML download finishes

843841Jul 8 2003 — edited May 9 2008
Once the client completes a download of XML info, as provided via the servlet, the browser window remains open. We are wondering if a servlet method in the HTTPServletResponse package will provide this functionality??

It may help to understand how the servlet download is functioning to better answer the question in the previous paragraph. In the "doGet()" method, the following HTTPServletResponse methods are set as shown:

1. The setContentType() method is supplied with an argument value of "application/octet-stream".
2. The setHeader() method's argument values contains the following, "Content-Disposition", "attachment; filename="testXMLFile.xml"".

Since the servlet is instructed not to open the information in standard html format, the browser's download dialog is displayed thereby permitting the client to save the file.

The problem is that once the download save is completed, this "empty" servlet window remains open. We are wondering if the capability exists (possibly from the "Servlet Response" package) to "trap" the download dialog event(s) and a scenario to actually close the window (possibly via Javascript).
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 6 2008
Added on Jul 8 2003
4 comments
327 views