Search code examples
javaswinghttprmi

RMI to HTTP protocol


Our project is a traditional project which is using RMI to do the communication between a Server and a Client (using Swing).

Recently, we want to change protocol from RMI to HTTP(for the firewall safety) without changing too much original code(keep original Server logic and Swing GUI).

Is there any good and mature way to do the transition? Thanks.


Solution

  • You can use your code as-is with the RMI/HTTP tunnelling that's built in to RMI. You just install the RMI-CGI servlet that's distributed with the sample code, configure it appropriately, and Bob's your auntie.

    See the documentation. Thanks to @JoopEggen for the link.