Thanks Martin

Was looking for such an example but couldn't find one right away. Works like a charm even though I don't really understand what's going on - is there some reading about request handler internals in wicket 1.5 somewhere?
The wiki pages do not seem to reflect any 1.5 behaviour yet...

Thanks
Matt

On 2011-05-26 13:55, Martin Grigorov wrote:
see how org.apache.wicket.markup.html.link.DownloadLink.onClick() does it

On Thu, May 26, 2011 at 2:52 PM, Matthias Keller
<matthias.kel...@ergon.ch>  wrote:
We have a dynamically generated PDF we send to the user.
I figured out a way to do it, but while it works, it produces lots of
stacktraces in wicket:

I created a PdfResource as subclass of ByteArrayResource.
When the user clicks the button, in the onClick() method we do:

PdfResource pdfResource = new PdfResource(data);
Attributes attrs = new Attributes(requestCycle.getRequest(),
requestCycle.getResponse());
pdfResource.respond(attrs);

This works so far, except that wicket doesn't know the response has already
been sent and tries to display the same page again - I somehow have to stop
processing the response, but how do I do that?
In Wicket 1.4 I could just throw an AbortException() which did just that.
How do I do that in Wicket 1.5 ?

Thanks
Matt



Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to