Hard to say without the context of the particular article. I'm not sure I've heard of a "distributed container", as much as I've heard of a distributed application (distributed between multiple containers).
In any event...
If you have an application server with more than one servlet container, then your application can be 'distributed' between the two containers. Two containers can theoretically handle twice the load. A single, complete copy of your application is loaded into each container.
Another meaning of distributed is when you cluster servers. This is more than one physical box, each with a single (or even multiple) containers. Like on a server farm.
Joined: Sep 14, 2001
One document that I read about Distributed Container is Servlet 2.4 Specification( Proposed Final Draft)... It said that "Context attributes are local to the VM in which they were created. This prevents ServletContext attributes from being a shared memory store in a distributed container." Example we implement distributed container for our application into 2 different machines. Who is reponsible to redirect our request to first machine or the other one? thanks daniel
Distributed container is deploying your application in two diffrent systems but logically they appear a single application to the user. In other words its known as clustering the application. This is done for load balancing and better performance
The segment of the spec you quoted:Context attributes are local to the VM in which they were created. This prevents ServletContext attributes from being a shared memory store in a distributed container
This is just a warning to developers about the nature of a distributed container. Imagine two instances of the same servlet, one in each of two containers.
Request 1 goes to Container 1 and calls the following:
normally, the foo attribute would be available in a JSP through the application object, or in other servlets through ServletContext.getAttribute()
Request 2 goes to Container 2 and calls:
This would return null, and not the expected "bar" String. Because the containers do not share the ServletContext.
As for you second example...Who is reponsible to redirect our request to first machine or the other one
This is accomplished by the container. If the container is distributed, then generally speaking that container would only be useful if it did its own distribution. The onus is NOT on the developer to do the distributing. All you have to worry about are issues like above, and be aware that certain (all?) objects are not shared.
"Who is reponsible to redirect our request to first machine or the other one" Does this has some relationship with the JNDI tree that build in the application server and can identify the servlet containers in distributed system ? or other implementation ? Just curious ...
Nothing is impossible to a willing heart .<br />----------------------------------<br />SCJP SCJD