Hi,
This is in connection with the query posted in Java (sun) forum dated Jul 31, 2003 and titled 'automatic redirect after file download'.
Any suggestions?
Thanks,
Anchal.
Hi,
Do you mean the page that contains the link? Well this page contains links corresponding to transactions. Since I'm using Struts, an Action class is responsible for forwarding the request to a JSP say 'main.jsp' that displays this page. When user clicks a link say 'T1' on this page, the request again goes to the Action class which then creates an xml file on the server. The request is now forwarded to the JSP that displays the 'file download' dialog box on the client browser.
The requirement is:
1. If the user selects 'Ok' button on the dialog box and completes the download process, a request should go to the Action class which would change the status of the transaction. The request should now be forwarded to 'main.jsp' to display the page without the link 'T1'.
2. If the user selects 'Cancel' button on the dialog box, nothing should happen.
Regards,
Anchal.
You can use server side sessionID to see if the download was requested, thereby knowing if the user clicked OK.
You can create a variable in Javascript to know if the user clicked the download button.
The combination would expose:
1. If download button was never clicked
2. If download button was clicked && file not requested
3. If download button was clicked && file was requested
Thanks for your guidance. But I still don't get as to how I should know whether the button clicked was the 'Ok' button or 'Cancel' button to assign an appropriate value to the JavaScript variable! For that matter capturing any event associated with 'file download' dialog box is a mystery to me (even its creation and closing)! Use of sessionID is also not clear to me.
Your help would be much appreciated.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.