why would you want a mounted page to create pdfs? servlets are so much better at that.
that said you can do getrequestcycle().setrequesttarget(new sometargetthatstreamspdfs()); throw new restartresponseexception(); -igor On Thu, Apr 9, 2009 at 12:39 AM, Stefan Lindner <lind...@visionet.de> wrote: > I need some trick to turn the response into a PDF stream. E. g. I have a > Bookmarkable Page PdfPAge > > public class PdfPage extends WebPage { > > public PdfPage (final PageParameters parameters) { > // Respond with PDF content. > } > } > > > Application.init() { > mountBookmarkablePage("/PdfGenerator", PdfPage.class); > > Is it possible to let a WebPage create a pdfOutput? If I try to do the > following > > Response r = getResponse(); > if (r instanceof WebResponse) { > WebResponse wr = (WebResponse)r; > wr.reset(); > OutputStream os = wr.getOutputStream(); > try { > os.write(/*PDFcontent*/); > } catch (Exception e) { > e.printStackTrace(); > } > } > } > > I can see the Exception java.lang.IllegalStateException: > getOutputStream() has already been called for this response > > The reason for this is: I did not find something like > BookmarkableResource in wicket. It is no problem to have a > DynaicResourceLink in a page but the displayes content is not > bookmarkable. Any Ideas? > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org