Return-Path: Delivered-To: apmail-jakarta-struts-user-archive@www.apache.org Received: (qmail 33495 invoked from network); 1 Dec 2003 20:31:55 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 1 Dec 2003 20:31:55 -0000 Received: (qmail 25736 invoked by uid 500); 1 Dec 2003 20:31:18 -0000 Delivered-To: apmail-jakarta-struts-user-archive@jakarta.apache.org Received: (qmail 25704 invoked by uid 500); 1 Dec 2003 20:31:18 -0000 Mailing-List: contact struts-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Struts Users Mailing List" Reply-To: "Struts Users Mailing List" Delivered-To: mailing list struts-user@jakarta.apache.org Received: (qmail 25686 invoked from network); 1 Dec 2003 20:31:17 -0000 Received: from unknown (HELO tmpsmtp702.honeywell.com) (199.64.7.102) by daedalus.apache.org with SMTP; 1 Dec 2003 20:31:17 -0000 Received: from 131.127.249.22 by tmpsmtp702.honeywell.com (InterScan E-Mail VirusWall NT); Mon, 01 Dec 2003 13:31:22 -0700 Received: from az18hb522.honeywell.com (az18hb522.allied.com [131.127.249.91]) by tmpcn197.wins.allied.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2657.72) id YB6462Y8; Mon, 1 Dec 2003 13:31:22 -0700 Received: by az18hb522.allied.com with Internet Mail Service (5.5.2657.72) id ; Mon, 1 Dec 2003 13:31:22 -0700 Message-ID: <9752D8977A3BD611BD0D00B0D0EA41830509F83E@aZ15m12> From: "Witt, Mike (OH35)" To: Struts Users Mailing List Subject: RE: Returning raw data from an action Date: Mon, 1 Dec 2003 13:30:59 -0700 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2657.72) Content-Type: text/plain; charset="iso-8859-1" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N When using FOP on a past project to output pdf, I used: response.setContentType("application/pdf"); response.setHeader("Content-Disposition", "attachment;filename=" + reportName + "; "); The second line caused it the browser to give a open/save dialog so that .csv does not appear in the browser window. Also I'm not sure if a content type other than text/plain is more appropriate for CSV, but it would be worth looking in to. Incidentally, when the action is completed, return null so that it does not forward anywhere. Mike -----Original Message----- From: Ben Anderson [mailto:stuts_andersonbd1@hotmail.com] Sent: Monday, December 01, 2003 3:12 PM To: struts-user@jakarta.apache.org Subject: Re: Returning raw data from an action from http://marc.theaimsgroup.com/?l=struts-user&m=106730742008404&w=2 modified slightly: // Now write the actual content type and data response.setContentType("text/plain"); JspWriter stream = response.getWriter(); ... write out the csv ... // Return null to tell Struts the response is complete return (null); -Ben >From: "Jim Kennedy" >Reply-To: "Jim Kennedy" >To: "Struts Users Mailing List" >Subject: Returning raw data from an action >Date: Mon, 1 Dec 2003 14:49:54 -0500 > >I have a need to process a large amount of data and return a csv file to >the >client. Is it possible to do this with a Struts action? Is so, what would >I return as an ActionForward (see below)? > >return mapping.findForward("blabla); > >or > >return mapping.findForward(null); > > >I don't want to forward anywhere. And I'm not returning HTML data either. >I know, I know should use model 2, but I can't in this case. Too much >overhead with 50k records. > > > >--------------------------------------------------------------------- >To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org >For additional commands, e-mail: struts-user-help@jakarta.apache.org > _________________________________________________________________ Share holiday photos without swamping your Inbox. Get MSN Extra Storage now! http://join.msn.com/?PAGE=features/es --------------------------------------------------------------------- To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: struts-user-help@jakarta.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: struts-user-help@jakarta.apache.org