Originally posted by Rama Raghavan:
1. How does the presence of this element in the web.xml force/guarantee the distributable nature of an app?
In its most basic form, it is no more than a flag to tell the container that this application should work with any distribution features that it has.
There are some intelligent things a container can do, though. In a distributable application, every session-bound object must be Serializable, so a container can enable some validation to check this even when it is not running in distributed mode.
2. Assume that the app is programmed properly.
If this element is NOT specified in web.xml for the app, does it mean it cannot be deployed in a distributable environment ?
Not as a distributed application in any case. You see, there is no automated way to find out whether an application is really fit to run in a distributed container. The Serializable check I described above is easy to do, but it is by no means enough. There are numerous other things that can bite you in a distributed application -- assumptions about Singletons, data consistency issues, transient fields, etc.
Only you, the developer, can decide whether the application can be distributed. And the distributable flag is how you make that decision known to the
servlet container.
Does this help?
- Peter