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 > >
-- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org