How do you manage sessions if the web servers are load balanced onto more than one server?
The JavaWorld article What's New in Java Servlet API 2.2? clarifies on the subject in the paragraph Distributed Applications.
The following is taken from that doc.
A few clarifications were also made in 2.2 with regards to distributed applications, in which application components can be spread across multiple back-end server machines.
The specification dictates that, for an application marked as distributable in its deployment descriptor, there will be a single
ServletContext instance per JVM. This means the context attributes cannot be used to share global information. Global information in a distributed app needs to be stored externally from the Web server, as is the case in database or EJB component.
Serializable. A Web server can throw an
IllegalArgumentExceptionif this condition is not met. Nondistributed apps, of course, can store any objects into the session.