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]

Reply via email to