Download through Outputstream
Hi I am using struts and my application downloads data in a PDF file. To make sure the download was successful I close the stream or flush it. Now I want to continue with my session by forwarding to another Struts action, unfortunately when the request is closed you cannot do a thing. Is there a way to move to another Struts action in this scenario? What if you want to give the user a confirmation screen with additional info? Thanks __ Standard Bank Disclaimer and Confidentiality Note This e-mail, its attachments and any rights attaching hereto are, unless the context clearly indicates otherwise, the property of Standard Bank Group Limited and/or its subsidiaries (the Group). It is confidential, private and intended for the addressee only. Should you not be the addressee and receive this e-mail by mistake, kindly notify the sender, and delete this e-mail, immediately and do not disclose or use same in any manner whatsoever. Views and opinions expressed in this e-mail are those of the sender unless clearly stated as those of the Group. The Group accepts no liability whatsoever for any loss or damages whatsoever and howsoever incurred, or suffered, resulting, or arising, from the use of this email or its attachments. The Group does not warrant the integrity of this e-mail nor that it is free of errors, viruses, interception or interference. Licensed divisions of the Standard Bank Group are authorised financial services providers in terms of the Financial Advisory and Intermediary Services Act, No 37 of 2002 (FAIS). For information about the Standard Bank Group Limited visit our website http://www.standardbank.co.za ___
Re: Download through Outputstream
Hi Mabusela, Try popping up a new window (try out with target=new attribute for html anchor element)that should call the action to generate PDF, while continue with your rest of the action in the parent browser. Regards, Thomas Joseph - Original Message - From: Mabusela, Koketso K [EMAIL PROTECTED] Hi I am using struts and my application downloads data in a PDF file. To make sure the download was successful I close the stream or flush it. Now I want to continue with my session by forwarding to another Struts action, unfortunately when the request is closed you cannot do a thing. Is there a way to move to another Struts action in this scenario? What if you want to give the user a confirmation screen with additional info? Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Download through Outputstream
Hi I did design it that way initially, unfortunately it was declined. No pop ups allowed. Thanks for the reply. -Original Message- From: Thomas Joseph [mailto:[EMAIL PROTECTED] Sent: 23 March, 2006 12:36 To: Struts Users Mailing List Subject: Re: Download through Outputstream Hi Mabusela, Try popping up a new window (try out with target=new attribute for html anchor element)that should call the action to generate PDF, while continue with your rest of the action in the parent browser. Regards, Thomas Joseph - Original Message - From: Mabusela, Koketso K [EMAIL PROTECTED] Hi I am using struts and my application downloads data in a PDF file. To make sure the download was successful I close the stream or flush it. Now I want to continue with my session by forwarding to another Struts action, unfortunately when the request is closed you cannot do a thing. Is there a way to move to another Struts action in this scenario? What if you want to give the user a confirmation screen with additional info? Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Standard Bank Disclaimer and Confidentiality Note This e-mail, its attachments and any rights attaching hereto are, unless the context clearly indicates otherwise, the property of Standard Bank Group Limited and/or its subsidiaries (the Group). It is confidential, private and intended for the addressee only. Should you not be the addressee and receive this e-mail by mistake, kindly notify the sender, and delete this e-mail, immediately and do not disclose or use same in any manner whatsoever. Views and opinions expressed in this e-mail are those of the sender unless clearly stated as those of the Group. The Group accepts no liability whatsoever for any loss or damages whatsoever and howsoever incurred, or suffered, resulting, or arising, from the use of this email or its attachments. The Group does not warrant the integrity of this e-mail nor that it is free of errors, viruses, interception or interference. Licensed divisions of the Standard Bank Group are authorised financial services providers in terms of the Financial Advisory and Intermediary Services Act, No 37 of 2002 (FAIS). For information about the Standard Bank Group Limited visit our website http://www.standardbank.co.za ___ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Download through Outputstream
Hi Koketso, I don't think you are going to be able to do what you want, at least not the way you describe. You won't be able to do anything server side with the binary stream (pdf) response once it is complete and you won't know on the client side when the pdf is finished or hung or whatever. You can't even guarantee that the user even downloaded it. When prompted for a download location, some browsers download in the background while the users decide where to put it, which they can always cancel at any point before, during, or after the response is complete. What you could do is present the user with a screen with something like ... Your download should begin in a moment, if it does not, click here - and link 'here' to the pdf download, all the while using a meta-refresh tag on that page that sends the user to the url to download the pdf. That's pretty much how downloads are done at sf.net, eclipse.org and many others. The difference would be that you would also present them with more instructions on the same page, what to do when the download was finished. The key is that you would want the user to be prompted to downloaded the file, and not let it load in the window or they'll lose those instructions. Worst case is that they don't read what you wanted them to do, but that's the lesser of all evils in all approaches. If anyone has a better solution, I'd love to hear it. -- James Mitchell Software Engineer / Open Source Evangelist Consulting / Mentoring 678.910.8017 - Original Message - From: Mabusela, Koketso K [EMAIL PROTECTED] To: user@struts.apache.org Sent: Thursday, March 23, 2006 4:06 AM Subject: Download through Outputstream Hi I am using struts and my application downloads data in a PDF file. To make sure the download was successful I close the stream or flush it. Now I want to continue with my session by forwarding to another Struts action, unfortunately when the request is closed you cannot do a thing. Is there a way to move to another Struts action in this scenario? What if you want to give the user a confirmation screen with additional info? Thanks __ Standard Bank Disclaimer and Confidentiality Note This e-mail, its attachments and any rights attaching hereto are, unless the context clearly indicates otherwise, the property of Standard Bank Group Limited and/or its subsidiaries (the Group). It is confidential, private and intended for the addressee only. Should you not be the addressee and receive this e-mail by mistake, kindly notify the sender, and delete this e-mail, immediately and do not disclose or use same in any manner whatsoever. Views and opinions expressed in this e-mail are those of the sender unless clearly stated as those of the Group. The Group accepts no liability whatsoever for any loss or damages whatsoever and howsoever incurred, or suffered, resulting, or arising, from the use of this email or its attachments. The Group does not warrant the integrity of this e-mail nor that it is free of errors, viruses, interception or interference. Licensed divisions of the Standard Bank Group are authorised financial services providers in terms of the Financial Advisory and Intermediary Services Act, No 37 of 2002 (FAIS). For information about the Standard Bank Group Limited visit our website http://www.standardbank.co.za ___ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Download through Outputstream
Hi Thanks for that tip. I will put a link to download if the download did not start. I can download the file the main problem was the post conditions. To execute my post condition, I just decided to call the execute methods of those Action classes directly because calling them with a findForward does not work because of the closed request. Thanks -Original Message- From: James Mitchell [mailto:[EMAIL PROTECTED] Sent: 23 March, 2006 13:13 To: Struts Users Mailing List Subject: Re: Download through Outputstream Hi Koketso, I don't think you are going to be able to do what you want, at least not the way you describe. You won't be able to do anything server side with the binary stream (pdf) response once it is complete and you won't know on the client side when the pdf is finished or hung or whatever. You can't even guarantee that the user even downloaded it. When prompted for a download location, some browsers download in the background while the users decide where to put it, which they can always cancel at any point before, during, or after the response is complete. What you could do is present the user with a screen with something like ... Your download should begin in a moment, if it does not, click here - and link 'here' to the pdf download, all the while using a meta-refresh tag on that page that sends the user to the url to download the pdf. That's pretty much how downloads are done at sf.net, eclipse.org and many others. The difference would be that you would also present them with more instructions on the same page, what to do when the download was finished. The key is that you would want the user to be prompted to downloaded the file, and not let it load in the window or they'll lose those instructions. Worst case is that they don't read what you wanted them to do, but that's the lesser of all evils in all approaches. If anyone has a better solution, I'd love to hear it. -- James Mitchell Software Engineer / Open Source Evangelist Consulting / Mentoring 678.910.8017 - Original Message - From: Mabusela, Koketso K [EMAIL PROTECTED] To: user@struts.apache.org Sent: Thursday, March 23, 2006 4:06 AM Subject: Download through Outputstream Hi I am using struts and my application downloads data in a PDF file. To make sure the download was successful I close the stream or flush it. Now I want to continue with my session by forwarding to another Struts action, unfortunately when the request is closed you cannot do a thing. Is there a way to move to another Struts action in this scenario? What if you want to give the user a confirmation screen with additional info? Thanks __ Standard Bank Disclaimer and Confidentiality Note This e-mail, its attachments and any rights attaching hereto are, unless the context clearly indicates otherwise, the property of Standard Bank Group Limited and/or its subsidiaries (the Group). It is confidential, private and intended for the addressee only. Should you not be the addressee and receive this e-mail by mistake, kindly notify the sender, and delete this e-mail, immediately and do not disclose or use same in any manner whatsoever. Views and opinions expressed in this e-mail are those of the sender unless clearly stated as those of the Group. The Group accepts no liability whatsoever for any loss or damages whatsoever and howsoever incurred, or suffered, resulting, or arising, from the use of this email or its attachments. The Group does not warrant the integrity of this e-mail nor that it is free of errors, viruses, interception or interference. Licensed divisions of the Standard Bank Group are authorised financial services providers in terms of the Financial Advisory and Intermediary Services Act, No 37 of 2002 (FAIS). For information about the Standard Bank Group Limited visit our website http://www.standardbank.co.za ___ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Standard Bank Disclaimer and Confidentiality Note This e-mail, its attachments and any rights attaching hereto are, unless the context clearly indicates otherwise, the property of Standard Bank Group Limited and/or its subsidiaries (the Group). It is confidential, private and intended for the addressee only. Should you not be the addressee and receive this e-mail by mistake, kindly notify the sender, and delete this e-mail, immediately and do not disclose or use same in any manner whatsoever. Views and opinions expressed in this e