I am working on porting an application to Tapestry 4. Have similar problem (dynamically generating PDF and returning it to client). I am new to Tapestry. I understand, I have to implement a service, but not sure how to do this, and what plumbing I have to connect.
There is limited documentation on this. As I understand this thread is talking about some example code. However, I do not understand where it is. Could anyone send the sample code, or some documentation on this topic. Thx -----Original Message----- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Dennis Sinelnikov Sent: Wednesday, January 10, 2007 12:18 PM To: users@tapestry.apache.org Subject: Re: AW: download a file Holger, This is what I did, perhaps it'll give you some hints on how to fix your problem: SomePage.html ... <input type="button" value="Download PDF Report" onClick="serviceLink()"/> ... <script type="text/javascript"> function serviceLink() { window.location='<span jwcid="@Insert" value="ognl:serviceURL" raw="true"/>'; </script> ... SomePage.java: ... @InjectObject("engine-service:download") public abstract IEngineService getDownloadService(); public String getServiceURL() { ILink link = this.getDownloadService().getLink(false, new String[]{...User Report Params...}); return link.getAbsoluteURL(); } ... I believe other code you can gather from Kent's book... hth, Dennis Holger Stolzenberg wrote: > Only partially! But actually I don´t know what the real problem is, so I > thought that maybe in your code I could figure out. > > We have the following issue (using tap 4.0.2 with tacos): > > I have form which is submit by a @Submit. In the form the user can edit > parameters that are needed for report creation. > The @Submit as a action binding which is calling a listener method. In this > listener method we want to generate a report with the parameters defined in > the form. Therefore we are using an custom IEngineService that returns the > PDF to the browser. > > Everything works fine but after the report has been created and has been sent > to the browser as PDF, a Exception is thrown saying that getOutputStream() > has already been called. We have read the section "Downloading ..." in Kents > book, but at the moment we have no idea where to go to stop this exception. > > -----Ursprüngliche Nachricht----- > Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von James Carman > Gesendet: Mittwoch, 10. Januar 2007 14:42 > An: Tapestry users > Betreff: Re: download a file > > Shing's code didn't show you what you needed? > > > On 1/10/07, Holger Stolzenberg <[EMAIL PROTECTED]> wrote: >> I am very intrested! Please share your code >> >> -----Ursprüngliche Nachricht----- >> Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von >> James Carman >> Gesendet: Mittwoch, 10. Januar 2007 02:32 >> An: Tapestry users >> Betreff: Re: download a file >> >> Let me know if Shing's example (it looks to be pretty good) isn't enough for >> you. The code I wrote was for a client, but there's really not much >> "clientness" to it, so I could probably share it. All it does is take image >> data out of a blob in the database and stream it back. Not rocket science >> by any means. The hardest part of it is the "servicey" bits. >> >> p.s. For the record, that's two phrases that I coined in the same >> email :-) >> >> >> >> >> On 1/9/07, Robert J. Walker <[EMAIL PROTECTED]> wrote: >>> James Carman wrote: >>> >>>> I did this by creating my own "service" in T4. >>> Have some code to share? I'm sure we'd all love to see it. >>> >>> >>> -------------------------------------------------------------------- >>> - To unsubscribe, e-mail: [EMAIL PROTECTED] >>> For additional commands, e-mail: [EMAIL PROTECTED] >>> >>> >>> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> >> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail and any files transmitted with it may contain confidential and/or privileged information. Use or disclosure of this e-mail or any such files by anyone other than a designated addressee is unauthorized. If you are not an intended recipient (or have received this email in error), please notify the sender immediately and delete this e-mail without making a copy. If this e-mail is misdirected, Silver Point Capital, L.P. and its affiliates do not waive any confidentiality or privilege. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]