I finally got back to this. I wrote up a service to send the csv files (using http://lombok.demon.co.uk/serviceHowTo/app - thanks Shing for the example - well done), which all works fine, but I have one question (which could easily be addressed by using the "unsanctioned" approach mentioned in the FAQ - thanks Nick).

Imagine you've done a bunch of work in home.html/home.java to create a set of data. Now you're ready to save it as a csv file. You click on the link which invokes the csv service, but it's unrealistic to pass all the parameters needed to re-create the data set to the service, or to even pass the data set itself (via a parameter). Home.java, of course, knows all about this set of data (as does the session). So how can the service be told to get the data set from Home.java (or from the session)? One way around it seems to be to use a regular @DirectLink, which would create the file and then redirect to the csv service, which would then stream the file (instead of assembling it on the fly). It would be nicer though if it can be done without writing intermediate files.

Any hints?

Thanks,

J

On 10-Jul-06, at 4:49 PM, Julian Wood wrote:


I would like to click a link, have a listener assemble a CSV file, and send it back as a download (ie change a few headers behind the scenes like Content-Type and Content-Disposition).

--
Julian Wood <[EMAIL PROTECTED]>

Software Engineer
Teaching & Learning Centre
University of Calgary

http://tlc.ucalgary.ca


Reply via email to