0

I have an already generated PDF on my server-side,I would like some help on showing the pdf when clicking a button on the client side.

How should I create the conextion with the server and client using the shared?

Thank you for your help.

Albert
  • 141
  • 3
  • 12

1 Answers1

1

Create a servlet and call it from client side on clicking a button.

String servletName = GWT.getModuleBaseURL().replace("/" + GWT.getModuleName(), "")
                     + "pdf_download_servlet";
Window.open(servletName, "", "");

For a servlet code please have a look at need a servlet to download a file.

Community
  • 1
  • 1
Braj
  • 46,415
  • 5
  • 60
  • 76
  • Can you explain me more about servlet? Please... I don't get how it works. – Albert Apr 24 '14 at 21:03
  • Follow this link [How do I return an image from a servlet using ImageIO?](http://www.avajava.com/tutorials/lessons/how-do-i-return-an-image-from-a-servlet-using-imageio.html) and read all the pages. – Braj Apr 24 '14 at 21:04