• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

access different context

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, I am wondering is there a way to access the different context? Assuming there are 2 application servers in different boxes. Now what I want is to use an object in server 'A' while I am in the other server 'B'. From Jason Hunter's book, servlet programing, mentioned that it is not available while that book's print. RMI seems a solution to this, but any other way?
 
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
Sun has very carefully made each servlet context independent as far as the Servlet and JSP APIs are concerned so you have to use another technology. The following will let you communicate with objects in a different servlet context (but not access the context directly).
1. Roll your own socket connection with
Object serialization (or just plain byte[])
2. RMI - sockets the easy way - the basis of J2EE communication.
3. shared database server
4. JMS Java Message Service (note that message beans using JMS are part of the latest J2EE API)
5. JavaSpaces - cool but takes some getting used to.
6. SOAP or XML-RPC (XML formatted text messages representing objects)
Bill
 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What about JDO ?
 
William Brogden
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
My understanding is that JDO (Java Data Objects) just provides an alternate interface to a database so its a special case of 3.
I am sure the ranch users would love to hear anybodies experience with JDO in a servlet setting.
Bill
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic