struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Newton <newton.d...@yahoo.com>
Subject Re: Problem generating a csv file for download
Date Mon, 02 Jun 2008 20:54:31 GMT
Isn't there something about IE that makes two calls, one with a "contype" user agent request
header? I remember seeing something about that somewhere relating to PDF documents; I have
no idea if it's similar for CSV or not, but it's easy enough to check the wire.

Dave


--- On Mon, 6/2/08, Jan Froehlich <Jan.Froehlich@infomotion.de> wrote:

> From: Jan Froehlich <Jan.Froehlich@infomotion.de>
> Subject: Problem generating a csv file for download
> To: "Struts Users Mailing List" <user@struts.apache.org>
> Date: Monday, June 2, 2008, 1:28 PM
> Hi List,
> 
> I'm developing an webapp generating csv files based on
> some hibernate
> queries - so far so good.
> 
> Action "csvSelect" is used to display a form with
> a select box and a
> datetimepicker and to pass 2 parameters to the second
> action
> "csvGenerate" which is the one that generates the
> csv file.
> 
> 		<action name="csvSelect"
> class="de.myfiles.actions.CsvSelect">
> 			<result name="success"
> type="redirectAction">
> 				<param
> name="actionName">csvGenerate</param>
> 			</result>
> 			<result name="input"
> type="tiles">tiles.page.select</result>
> 		</action>
> 
> 		<action name="csvGenerate"
> class="de.myfiles.actions.CsvGenerate">
> 			<result name="success"
> type="stream"></result>
> 		</action>
> To this point everything is working like a charm. 
> But when I set 
> 
> 			response.setHeader("Content-Disposition",
> "attachment; filename=myfile.csv");
> 			response.setContentType("text/x-download");
> 
> The action is called once and building my csv content -
> after I return
> SUCCESS it displays the Internet Explorer "Open /
> Save" dialog and when
> I click on "open" or "save" the action
> is called another time - but now
> I dont have access to the parameters passed from the first
> action.
> 
> As I am new to struts2 and I am no native speaker I hope
> that someone
> understands what my problem is and gives me a clue!
> 
> Thanks in advance!
> 
> Jan Froehlich
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail:
> user-help@struts.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message