客户端-服务器基础架构中的 Applet
我有一个关于客户端-服务器设计的一般性问题。
我们的站点有一个带有 Spring 的 Java 服务器、一个 GWT 客户端程序和一些 HTTP-servlet。 目前我们还想开发一个小程序,它可以像 GWT 客户端和站点请求那样与该服务器进行通信。
通过 RMI 从小程序与服务器进行通信是个好主意吗?即创建一些远程服务,将它们注册到Spring并从applet调用它们?
提前致谢!
I have a general question concerning client-server design.
We have a Java server with Spring, a GWT client program and some HTTP-servlets for our site.
At the moment we also want to develop an applet which would communicate with that server in such a way GWT-client and site requests do.
Is it a good idea to communicate with the server from applet by RMI? I.e. to create some Remote services, register them with Spring and call them from applet?
Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当然,这是 RMI 最初的主要用例之一。当然,Spring 让 RMI 变得非常简单,并且让小程序与它对话应该是一件容易的事。
一个重要警告 - 如果您的小程序客户端位于防火墙后面,那么 RMI 几乎肯定无法工作。如果是这种情况,那么您必须通过 HTTP 建立 RMI 隧道(请参阅 文档)。或者,您可以使用 Spring 的 HTTP 远程处理,但这意味着将一些 Spring JAR 与小程序一起打包,您可能不想这样做。
Absolutely, that was one of RMI's original primary use cases. Spring makes RMI amusingly easy, of course, and it should be an easy task to get the applet talking to it.
One big caveat - if your applet clients are behind a firewall, then RMI will almost certainly not work. If this is the case, then you'll either have to tunnel RMI over HTTP (see docs). Alternatively, you vould use Spring's HTTP remoting, but that would mean packaging some Spring JARs with the applet, which you may not want to do.