This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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 !!
Consider Paul's rocket mass heater.
subject: Servlets and RMI
Similar Threads
This Weeks Giveaway
Ejb Protocol
RMI required?
how many ways do two java program communicate?