• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

access different context

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • 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
 
And tomorrow is the circus! We can go to the circus! I love the circus! We can take this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic