CSVExport always sends chunked data

UI Components for JSF
Post Reply
michaelmueller
Posts: 2
Joined: 27 Dec 2010, 15:11

27 Dec 2010, 15:22

Hi,

I'm using the dataExporter in the following way to generate CSV-Files:
<p:dataExporter type="csv" target="myList" fileName="list" />

In some cases it works as expected, i. e. the browser pops up a dialog box, asking me what I want to do with the file, suggesting that I opened it with Excel.
In other cases the CSV-Output gets displayed in a browser window and no dialog box showed up.
Using the Firefox-Plugin "Live HTTP Headers" I was able to find out that the response came back with a HTTP-Header
Transfer-Encoding: chunked
set.

Debugging the CSVExporter I think I might have found out what the "problem" is:
The CSVExporter first writes the body in the OutputStream's PrintWriter and THEN sets the contentType, and HTTP-Headers.
From my understanding it has to be the other way around...

Am I right here?

Can anyone plz help me on bringing up the browser's download window when the CSV comes up?

Kind regards,
Michael

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

28 Dec 2010, 17:44

Is there a way we can replicate this easily?

michaelmueller
Posts: 2
Joined: 27 Dec 2010, 15:11

29 Dec 2010, 17:41

Unfortunately not :-(
Still my question remains wether the implemented order of
- writing the data to the ServletOutputStream
- then setting the headers
is meaningful.

Regards,
Michael

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 26 guests