我想在我的网页上显示pdf文件,我正在使用GWT.
可以编写这个简单的代码:
Frame frame = new Frame();
frame.setUrl("http://127.0.0.1:8888/documents/file.pdf");
Run Code Online (Sandbox Code Playgroud)
但是,我认为这种方式无法管理授权,因为拥有该URL的每个人都可以看到pdf文档.
使用GWT文件处理此授权问题的建议是什么?
如果您的pdf文件直接从Java servlet容器(例如Tomcat,Jetty,...)提供,您可以使用Servlet过滤器,它会检查
您可以使用http://www.developer.com/security/article.php/3467801/Securing-J2EE-Applications-with-a-Servlet-Filter.htm作为起点 - 并根据您的要求进行调整(例如您不必像作者那样使用Spring).