RE: PDF Streamed To Client

2005-04-27 Thread Brian McGovern
cases where in practice its a better idea to stray from stringent mvc pattern. But I'm just a hack. :) -B -Original Message- From: Andre Van Klaveren [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 26, 2005 4:51 PM To: Struts Users Mailing List; Nick Heudecker Subject: Re: PDF Streamed

Re: PDF Streamed To Client

2005-04-27 Thread Andre Van Klaveren
Mailing List; Nick Heudecker Subject: Re: PDF Streamed To Client Brian, While Nick's solution certainly works, it doesn't follow best practices, MVC in particular (No offense Nick). Technically a view component such as a Servlet or JSP should be responsible for writing the response back

PDF Streamed To Client

2005-04-26 Thread Brian McGovern
I'm wondering if anyone has any tips on how to render a pdf with struts. I want to mask the name of the pdf and just stream it to client. Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail:

Re: PDF Streamed To Client

2005-04-26 Thread Nick Heudecker
Brian: This is pretty simple. Just get the output stream from the response object and stream the file down. Return null from the Action's execute method: private void returnFile(File f, OutputStream out) throws IOException { FileInputStream fis = null; try { fis

RE: PDF Streamed To Client

2005-04-26 Thread Brian McGovern
great.. its the return null part i was missing.. thanks.! -Original Message- From: Nick Heudecker [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 26, 2005 1:47 PM To: Struts Users Mailing List Subject: Re: PDF Streamed To Client Brian: This is pretty simple. Just get the output stream

Re: PDF Streamed To Client

2005-04-26 Thread Niall Pemberton
Or use the new DownloadAction - it is in the Struts 1.2.6 beta version, Details on the wiki http://wiki.apache.org/struts/StrutsFileDownload http://svn.apache.org/dist/struts/v1.2.6/ Niall - Original Message - From: Nick Heudecker [EMAIL PROTECTED] Sent: Tuesday, April 26, 2005 6:46

Re: PDF Streamed To Client

2005-04-26 Thread Jeff_Caswell
I have successfully used the following technique for file download via an action: Set the mimetype in the web.xml Do nothing action always returns 'success' points to tiles def for file to be downloaded action-map: action path=/fileDownloadAction type=com.foo.action.SuccessAction

RE: PDF Streamed To Client

2005-04-26 Thread Brian McGovern
Mailing List Subject: Re: PDF Streamed To Client I have successfully used the following technique for file download via an action: Set the mimetype in the web.xml Do nothing action always returns 'success' points to tiles def for file to be downloaded action-map: action path=/fileDownloadAction

RE: PDF Streamed To Client

2005-04-26 Thread Brian McGovern
Follow Up: This works but im having a little trouble outputting the content type appropriately. -B -Original Message- From: Nick Heudecker [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 26, 2005 1:47 PM To: Struts Users Mailing List Subject: Re: PDF Streamed To Client Brian

RE: PDF Streamed To Client

2005-04-26 Thread Brian McGovern
Nevermind. Dumb question. I got it. -Original Message- From: Brian McGovern [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 26, 2005 4:01 PM To: Struts Users Mailing List; Nick Heudecker Subject: RE: PDF Streamed To Client Follow Up: This works but im having a little trouble

Re: PDF Streamed To Client

2005-04-26 Thread Nick Heudecker
-Original Message- From: Nick Heudecker [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 26, 2005 1:47 PM To: Struts Users Mailing List Subject: Re: PDF Streamed To Client Brian: This is pretty simple. Just get the output stream from the response object and stream the file down

Re: PDF Streamed To Client

2005-04-26 Thread Andre Van Klaveren
Brian, While Nick's solution certainly works, it doesn't follow best practices, MVC in particular (No offense Nick). Technically a view component such as a Servlet or JSP should be responsible for writing the response back to the client. The Action is responsible for flow control and