I have come accross this word number of times and I would like to clarify what I am thinking. So if my web application is distributable(say in 2 machines) machine1 webapp shan webinf similarly in machine 2 I have the same directory structure. ie webapp shan web-inf am I correct??? is this what is distributable ???
"Distributable" refers to the ability to run a single servlet container on multiple JVMs and even multiple machines. This gives you better scalability (just add more machines) and failover (if a machine dies, the others can take over). The crucial difference between a distributed container and just running multiple ordinary containers is that a distributed container will have some mechanism to share HTTP sessions between the machines. For example, it may serialize the session and store it into a shared database. I said "serialize". This is an important point in a distributable web application. When you mark a web-app as "distributable", all objects you store in the HttpSession must be serializable. Otherwise, the container can't do its distribution magic. You must also not use any techniques that break in a distributed container; for example, any instance of the Singleton pattern is potentially suspect as each JVM will get its own copy of the "Singleton". Well, most attempts at implementing Singletons in web containers are broken anyway, with class reloading and all that. - Peter
Just one minor correction to what Peter said. Sessions are not actually shared accross multiple JVMs. They can, however, be moved across multiple JVMs. The point is, an HttpSession will be available only on one JVM at a time (so no sharing since only one JVM has exclusive access to the session). And all the requests belonging to that session will be serviced by that JVM. In case of failover or load balancing, the clustor manager can "move" this session to another server. This is in contrast with the non-default servlet contexts, where each JVM has it's own copy of the the ServletContext. In this case also there is no sharing because each JVM has exclusive access to it's own copy.
The longest recorded flight time of a chicken is 13 seconds. But that was done without this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!