2. Motivation

Now that more and more Servlets and JavaServer Pages (JSPs) are being deployed on the web, there is often a need to notify and synchronize client web-browsers from state changes in server objects after the browser has loaded a page.

These changes can be caused by users updating an EJB through a servlet or database record or by events in a multi-user application such as chat and shared whiteboard. These type of applications often use a distributed Model View Controller (MVC) pattern where the Model is on the server (with possible caching in clients) and the Control and View (possibly combined) reside within the client.

There are also applications where we would like to subcribe to dynamic content that is continuously pushed from the server. Examples stock feeds, system status, weather conditions or other monitoring applications. This follows an Observer (a.k.a. Publish/Subscribe) pattern where remote clients (Observers) register for updates from server objects (Subjects).

How can we notify browser-clients after their HTML page has loaded ? Or what to do if we would like to selectively update only parts of a page. For example only the stock item in an HTML TABLE whose rate has changed ?