Applet in client

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? Ie to create some Remote services, register them with Spring and call them from applet?

Thanks in advance!


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.

链接地址: http://www.djcxy.com/p/55936.html

上一篇: Java applet与tomcat服务器上的servlet通信

下一篇: Applet在客户端