I did that by passing ognl expression (as string) that specifies the dataset as 
parameter to the service, so the service simply evaluates the OGNL expression 
and uses its result as source.
 
Konstantin Ignatyev 
 

 
PS: If this is a typical day on planet earth, humans will add fifteen million 
tons of carbon to the atmosphere, destroy 115 square miles of tropical 
rainforest, create seventy-two miles of desert, eliminate between forty to one 
hundred species, erode seventy-one million tons of topsoil, add 2,700 tons of 
CFCs to the stratosphere, and increase their population by 263,000
 
Bowers, C.A.  The Culture of Denial:  Why the Environmental Movement Needs a 
Strategy for Reforming Universities and Public Schools.  New York:  State 
University of New York Press, 1997: (4) (5) (p.206)

----- Original Message ----
From: Julian Wood <[EMAIL PROTECTED]>
To: Tapestry users <users@tapestry.apache.org>
Sent: Tuesday, July 18, 2006 2:47:08 PM
Subject: Re: handling file downloads

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







---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to