struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jan Froehlich" <Jan.Froehl...@infomotion.de>
Subject Problem generating a csv file for download
Date Mon, 02 Jun 2008 17:28:23 GMT
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


Mime
View raw message