Hi,
Please refer to the code below:
This code is part of a jsp that is invoked when I click a link on a page in the browser to download an xml file.
The download works fine. But I also want
1. the page to get refreshed after the download is complete.
2. when I click 'cancel' button on the 'file download' dialog box, I want to get redirected to a servlet.
How can I go about achieving this?
Thanks in advance,
Anchal.
Please refer to the code below:
Code:
response.setContentType ("application/xml");
response.setHeader ("Content-Disposition", "attachment; filename=\"my.xml\"");
java.io.BufferedReader in = new java.io.BufferedReader(new java.io.FileReader(xmlPath));
String s = null;
while((s = in.readLine()) != null) {
out.write(s);
}
The download works fine. But I also want
1. the page to get refreshed after the download is complete.
2. when I click 'cancel' button on the 'file download' dialog box, I want to get redirected to a servlet.
How can I go about achieving this?
Thanks in advance,
Anchal.