|
Pushlets - Whitepaper
|
Let's assume that we have a Java web/application server from which we want to notify client browsers. Solutions we have can be categorized as "polling", "server-side callbacks" and "messaging".
Each of the above solutions has its advantages/disadvantages in complexity, security, performance, scalability, browser Java compatibility and restrictions like firewalls. The most optimal solution strongly depends on what your application is supposed to do. For example, when users require a direct interaction with the state such as in a shared whiteboard, server side-callbacks or messaging can be a powerful technique.
But we are still within a browser and unless the applet constitutes the entire client application, it is hard to integrate updates coming from the server with the HTML content. How can we alter this content from within the applet when it gets the callback or message ? One solution is to refresh the page by calling AppletContext.showDocument(URL) within the callback method.
Since HTML is meant for layout, wouldn't it be nice to be able to directly alter parts of the HTML content with incremental data coming from the server ? This would be an ideal scheme for web-applications where content on the server is dynamically changing and the required user-to-server interaction is minimal, e.g. driven by HTML FORMs.
In addition to the above solutions I have developed a technique that is lightweight, thin on the client, requires no applets or plug-ins, directly integrates with scripting/HTML, uses standard HTTP connections and can be deployed (in theory!) in any Java servlet-server. It is certainly not meant to replace the above solutions. My intention is to add another option to your toolbox. You as Java architects/developers should determine the trade-offs and choose what is best for your particular application.
|
Pushlets - Whitepaper
|