Re: downloading of files
Hi, I don't know if this is a good way or not, but heres what I did: httpServletResponse.setContentType("text/tsv"); //Whatever mime type you need. PrintWriter out = httpServletResponse.getWriter(); ...Use the print writer to create the download file out.close(); return null; When a user clicks on the link for this action, it creates and downloads the file, but doesn't leave the page the user is currently on. cio Derek On Monday 08 December 2003 20:33, Viral_Thakkar wrote: > Is there any struts support to download the files? > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] -- Regards, Derek Clarkson .O. Analyst/Programmer ..O Waterwerks Pty Ltd OOO Melbourne, Australia - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: downloading of files
I have a compression servlet demo available from my site (www.christianbollmeyer.de) which should basically do everything you're asking for. Used this to track down someone's problem with gzip and different browser clients, so it's a hack more or less. The code from the doGet() method goes to the Action's execute() one. -- Chris. - Original Message - From: "Viral_Thakkar" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Monday, December 08, 2003 1:17 PM Subject: RE: downloading of files Can u please look at http://www.mail-archive.com/[EMAIL PROTECTED]/msg15750.html and tell me what code need to go in the download action class? -Original Message- From: Firat TIRYAKI [mailto:[EMAIL PROTECTED] Sent: Monday, December 08, 2003 5:39 PM To: Struts Users Mailing List Subject: Re: downloading of files well, if you want to authenticate users to download the files, your software should handle the direct file requests (for example http://localhost/download/x.gif), because the direck file requests does not call action servlet in a standart struts designed web.xml file. With a servlet you can manage the direct requests, URLs like the example above. Let me give you the web.xml part to give you the idea DownloadAccessor DownloadAccessor com.mypackage.DownloadAccessor 10 DownloadAccessor /downloads/* F. - Original Message - From: "Viral_Thakkar" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" <[EMAIL PROTECTED]> Sent: Monday, December 08, 2003 1:55 PM Subject: RE: downloading of files Should I write the action class for the download functionality or servlet code required? -Original Message- From: Firat TIRYAKI [mailto:[EMAIL PROTECTED] Sent: Monday, December 08, 2003 3:45 PM To: Struts Users Mailing List Subject: Re: downloading of files Define a download accessor class (that you'll write using servlet functionality) in the web.xml file that manages the file when requested. F. - Original Message - From: "Viral_Thakkar" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" <[EMAIL PROTECTED]> Sent: Monday, December 08, 2003 12:00 PM Subject: RE: downloading of files I have a screen which provides support to upload and download the files. To upload the files, I am using the struts example. Now, I need to know how to implement the "download/display details" functionality. Regards, Viral -Original Message- From: Kwok Peng Tuck [mailto:[EMAIL PROTECTED] Sent: Monday, December 08, 2003 3:14 PM To: Struts Users Mailing List Subject: Re: downloading of files I assume that your Action prompts the user (the guy using the browser) to save the file ? Viral_Thakkar wrote: >Is there any struts support to download the files? > >- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: downloading of files
Viral, I'm talking about the servlet, not struts action, mine is an alternative for you, and the thread you send is about the actions, use it if you want... F. - Original Message - From: "Viral_Thakkar" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Monday, December 08, 2003 2:17 PM Subject: RE: downloading of files Can u please look at http://www.mail-archive.com/[EMAIL PROTECTED]/msg15750.html and tell me what code need to go in the download action class? -Original Message- From: Firat TIRYAKI [mailto:[EMAIL PROTECTED] Sent: Monday, December 08, 2003 5:39 PM To: Struts Users Mailing List Subject: Re: downloading of files well, if you want to authenticate users to download the files, your software should handle the direct file requests (for example http://localhost/download/x.gif), because the direck file requests does not call action servlet in a standart struts designed web.xml file. With a servlet you can manage the direct requests, URLs like the example above. Let me give you the web.xml part to give you the idea DownloadAccessor DownloadAccessor com.mypackage.DownloadAccessor 10 DownloadAccessor /downloads/* F. - Original Message - From: "Viral_Thakkar" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" <[EMAIL PROTECTED]> Sent: Monday, December 08, 2003 1:55 PM Subject: RE: downloading of files Should I write the action class for the download functionality or servlet code required? -Original Message- From: Firat TIRYAKI [mailto:[EMAIL PROTECTED] Sent: Monday, December 08, 2003 3:45 PM To: Struts Users Mailing List Subject: Re: downloading of files Define a download accessor class (that you'll write using servlet functionality) in the web.xml file that manages the file when requested. F. - Original Message - From: "Viral_Thakkar" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" <[EMAIL PROTECTED]> Sent: Monday, December 08, 2003 12:00 PM Subject: RE: downloading of files I have a screen which provides support to upload and download the files. To upload the files, I am using the struts example. Now, I need to know how to implement the "download/display details" functionality. Regards, Viral -Original Message- From: Kwok Peng Tuck [mailto:[EMAIL PROTECTED] Sent: Monday, December 08, 2003 3:14 PM To: Struts Users Mailing List Subject: Re: downloading of files I assume that your Action prompts the user (the guy using the browser) to save the file ? Viral_Thakkar wrote: >Is there any struts support to download the files? > >- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: downloading of files
Can u please look at http://www.mail-archive.com/[EMAIL PROTECTED]/msg15750.html and tell me what code need to go in the download action class? -Original Message- From: Firat TIRYAKI [mailto:[EMAIL PROTECTED] Sent: Monday, December 08, 2003 5:39 PM To: Struts Users Mailing List Subject: Re: downloading of files well, if you want to authenticate users to download the files, your software should handle the direct file requests (for example http://localhost/download/x.gif), because the direck file requests does not call action servlet in a standart struts designed web.xml file. With a servlet you can manage the direct requests, URLs like the example above. Let me give you the web.xml part to give you the idea DownloadAccessor DownloadAccessor com.mypackage.DownloadAccessor 10 DownloadAccessor /downloads/* F. - Original Message - From: "Viral_Thakkar" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" <[EMAIL PROTECTED]> Sent: Monday, December 08, 2003 1:55 PM Subject: RE: downloading of files Should I write the action class for the download functionality or servlet code required? -Original Message- From: Firat TIRYAKI [mailto:[EMAIL PROTECTED] Sent: Monday, December 08, 2003 3:45 PM To: Struts Users Mailing List Subject: Re: downloading of files Define a download accessor class (that you'll write using servlet functionality) in the web.xml file that manages the file when requested. F. - Original Message - From: "Viral_Thakkar" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" <[EMAIL PROTECTED]> Sent: Monday, December 08, 2003 12:00 PM Subject: RE: downloading of files I have a screen which provides support to upload and download the files. To upload the files, I am using the struts example. Now, I need to know how to implement the "download/display details" functionality. Regards, Viral -Original Message- From: Kwok Peng Tuck [mailto:[EMAIL PROTECTED] Sent: Monday, December 08, 2003 3:14 PM To: Struts Users Mailing List Subject: Re: downloading of files I assume that your Action prompts the user (the guy using the browser) to save the file ? Viral_Thakkar wrote: >Is there any struts support to download the files? > >- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: downloading of files
well, if you want to authenticate users to download the files, your software should handle the direct file requests (for example http://localhost/download/x.gif), because the direck file requests does not call action servlet in a standart struts designed web.xml file. With a servlet you can manage the direct requests, URLs like the example above. Let me give you the web.xml part to give you the idea DownloadAccessor DownloadAccessor com.mypackage.DownloadAccessor 10 DownloadAccessor /downloads/* F. - Original Message - From: "Viral_Thakkar" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" <[EMAIL PROTECTED]> Sent: Monday, December 08, 2003 1:55 PM Subject: RE: downloading of files Should I write the action class for the download functionality or servlet code required? -Original Message- From: Firat TIRYAKI [mailto:[EMAIL PROTECTED] Sent: Monday, December 08, 2003 3:45 PM To: Struts Users Mailing List Subject: Re: downloading of files Define a download accessor class (that you'll write using servlet functionality) in the web.xml file that manages the file when requested. F. - Original Message - From: "Viral_Thakkar" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" <[EMAIL PROTECTED]> Sent: Monday, December 08, 2003 12:00 PM Subject: RE: downloading of files I have a screen which provides support to upload and download the files. To upload the files, I am using the struts example. Now, I need to know how to implement the "download/display details" functionality. Regards, Viral -Original Message- From: Kwok Peng Tuck [mailto:[EMAIL PROTECTED] Sent: Monday, December 08, 2003 3:14 PM To: Struts Users Mailing List Subject: Re: downloading of files I assume that your Action prompts the user (the guy using the browser) to save the file ? Viral_Thakkar wrote: >Is there any struts support to download the files? > >- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: downloading of files
Should I write the action class for the download functionality or servlet code required? -Original Message- From: Firat TIRYAKI [mailto:[EMAIL PROTECTED] Sent: Monday, December 08, 2003 3:45 PM To: Struts Users Mailing List Subject: Re: downloading of files Define a download accessor class (that you'll write using servlet functionality) in the web.xml file that manages the file when requested. F. - Original Message - From: "Viral_Thakkar" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" <[EMAIL PROTECTED]> Sent: Monday, December 08, 2003 12:00 PM Subject: RE: downloading of files I have a screen which provides support to upload and download the files. To upload the files, I am using the struts example. Now, I need to know how to implement the "download/display details" functionality. Regards, Viral -Original Message- From: Kwok Peng Tuck [mailto:[EMAIL PROTECTED] Sent: Monday, December 08, 2003 3:14 PM To: Struts Users Mailing List Subject: Re: downloading of files I assume that your Action prompts the user (the guy using the browser) to save the file ? Viral_Thakkar wrote: >Is there any struts support to download the files? > >- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: downloading of files
Define a download accessor class (that you'll write using servlet functionality) in the web.xml file that manages the file when requested. F. - Original Message - From: "Viral_Thakkar" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" <[EMAIL PROTECTED]> Sent: Monday, December 08, 2003 12:00 PM Subject: RE: downloading of files I have a screen which provides support to upload and download the files. To upload the files, I am using the struts example. Now, I need to know how to implement the "download/display details" functionality. Regards, Viral -Original Message- From: Kwok Peng Tuck [mailto:[EMAIL PROTECTED] Sent: Monday, December 08, 2003 3:14 PM To: Struts Users Mailing List Subject: Re: downloading of files I assume that your Action prompts the user (the guy using the browser) to save the file ? Viral_Thakkar wrote: >Is there any struts support to download the files? > >- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: downloading of files
Hmm, how about a page which provides a link or button(form) to the action which then starts the download ? Of course some variable can be submitted with the form to indicate to the Action which file should be sent to the browser. As for sending the content to the browser, you can just write the content to the response body (assuming that you have set the content type correctly) . Viral_Thakkar wrote: I have a screen which provides support to upload and download the files. To upload the files, I am using the struts example. Now, I need to know how to implement the "download/display details" functionality. Regards, Viral -Original Message- From: Kwok Peng Tuck [mailto:[EMAIL PROTECTED] Sent: Monday, December 08, 2003 3:14 PM To: Struts Users Mailing List Subject: Re: downloading of files I assume that your Action prompts the user (the guy using the browser) to save the file ? Viral_Thakkar wrote: Is there any struts support to download the files? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: downloading of files
I have a screen which provides support to upload and download the files. To upload the files, I am using the struts example. Now, I need to know how to implement the "download/display details" functionality. Regards, Viral -Original Message- From: Kwok Peng Tuck [mailto:[EMAIL PROTECTED] Sent: Monday, December 08, 2003 3:14 PM To: Struts Users Mailing List Subject: Re: downloading of files I assume that your Action prompts the user (the guy using the browser) to save the file ? Viral_Thakkar wrote: >Is there any struts support to download the files? > >- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: downloading of files
I assume that your Action prompts the user (the guy using the browser) to save the file ? Viral_Thakkar wrote: Is there any struts support to download the files? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: downloading of files
what exactly you want to do? please be more spesific. F. - Original Message - From: "Viral_Thakkar" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" <[EMAIL PROTECTED]> Sent: Monday, December 08, 2003 11:33 AM Subject: downloading of files Is there any struts support to download the files? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]