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
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
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:
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
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
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
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
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
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
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
-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
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
12 matches
Mail list logo