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?
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
<a href="http://www.javablackbelt.com/?utm_source=javaranch&utm_medium=signature&utm_campaign=Forum%2BBuzz" target="_blank" rel="nofollow">BlackBeltFactory Communtiy</a> founder - Building better developers<br /><b>Free</b> courses and mock exams
Author and all-around good cowpoke
Joined: Mar 22, 2000
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