views:

29

answers:

1

Hello!

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!

+1  A: 

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.

skaffman