SmartGWT/GWT: Show a PDF on client side

2019-09-18 10:16发布

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.

1条回答
兄弟一词,经得起流年.
2楼-- · 2019-09-18 10:59

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.

查看更多
登录 后发表回答