• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

can rmi be used with servlets?

 
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
i am a beginner to servlets. i was informed that jdbc and applets could be used with servlets. i would like to know whether rmi could be used with servlets. if so how?


with regards,
arun.
 
Ranch Hand
Posts: 216
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
RMI runs over JRMP or IIOP. Servlets are server side java modules that extend the functionality of a server. Servlets out there are mostly HTTPServlets and they extend the functionality of the Web server. Because they run on HTTP, can't be used. I would guess that then GenericServlet can be used because it is protocol-independent. I haven't had a chance to see one example that has used it though.
Please anybody correct me if I am wrong!
Vladan
 
Desperado
Posts: 3226
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
But an HttpServlet is a GenericServlet
So anything that a GenericServlet can do, and HttpServlet can also do.
But most importantly, Servlets have access to the whole Java API including RMI.
They use HTTP to communicate back to the client (a browser?) But nothing prevents them from using any other protocol to communicate. They could open sockets to other servers if needed, e.g.
 
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, Servlet can work with RMI. I have created a servlet front end that invokes a remote object on another host to perform a socket connectivity test and returns the test result back to the servlet. It works perfectly.
This reply may be a little too late. I am new to this site and found the info here is very helpful. Just try to make some contribution.
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Servlets can do anything a Java application can do - I have a RMI example in the servlets book. Basically the only things you have to watch out for are catching exceptions and synchronizing access.
Bill
------------------
author of:
 
Just let me do the talking. Ahem ... so ... you see ... we have this tiny ad...
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic