File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Servlets and RMI Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Servlets and RMI" Watch "Servlets and RMI" New topic

Servlets and RMI

Varun Rupela

Joined: Feb 17, 2002
Posts: 12
Can a Servlet access a method remotely, using RMI (and use the returned data in its output)?

Varun Rupela<br />Graduate Research Assistant<br />Department of Computer Science and Software Engineering.<br />Auburn University.
ralph roper

Joined: Nov 25, 2001
Posts: 25
Yes. In summary this is how you do it.
Create your RMI server class, implementation class and interface class and then compile with javac and rmic. rmic will create the skeleton and stub classes. Copy the skeleton, stub and interface classes to the client. Start the rmiregistry process and then run your server class.
On the client your servlet will need to bind to the registry service running on the server. Once this is done you can call the remote methods in your servlet.
Sun has a good rmi tutorial if you need more detail.
Varun Rupela

Joined: Feb 17, 2002
Posts: 12
Thanks Ralph !!
I agree. Here's the link:
subject: Servlets and RMI
It's not a secret anymore!