Look in the mail archives. This has been discussed two weeks ago

On Mon, Jul 18, 2011 at 9:55 PM, Fred <smiths...@hotmail.com> wrote:
> Hello,
> I am trying to open this pdf in a new window with no sucess.
>
>
>  protected void onSubmit()
>  {
>      final ByteArrayOutputStream pdfout = PDFHelper.genPDF();
>      final Response response = getRequestCycle().getResponse();
>      response.setContentType("application/pdf");
>      response.setContentLength(pdfout.size());
>      getRequestCycle().setRequestTarget(new IRequestTarget();
>      {
>             public void detach(RequestCycle requestCycle) { }
>        public void respond(RequestCycle requestCycle)
>        {
>              try
>              {
>                   OutputStream stream = response.getOutputStream();
>                   stream.write(pdfout.toByteArray());
>                   stream.flush();
>                   pdfout.close();
>               }
>               catch(IOException ex)
> .....
>
> I am totally new to wicket (and java) and could really use some help with
> this.
>
> Thanks
>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/Open-PDF-in-a-new-window-tp3676139p3676139.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>



-- 
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

Reply via email to