AjaxServlet (by Phil Sladen phil@activewebsites.co.uk)

Overview

Provides a simple framework to integrate Ajax updates into a JSP/Servlet environment. It simplifies the updating of: It contains the following:

All you need to do

jajaxUpdate() request format

The format of the request string is as follows:
<AjaxServlet>?class=<handlerClass>&jxid=<Id1>&jxid=<Id2>...[&jxdebug] [+your own parameters]
Where: <Id1>, <Id2> etc are DOM targets in your current web page that need updating. The 'jxid' parameter name can have a number appended to force a numeric order in which the targets are processes. If you append the parameter 'jxdebug', then an alert() popup will display the page updates that will be applied as a result of the request.

Request processing

The servlet instantiates the handler class specified in the request, and then calls it for each of the 'jxid' parameters. The handler class returns updates, which the servlet accumulates and then returns to the Javascript caller, jajaxUpdate(). Pretty much all the caller does is pass the result to 'eval()' to perform the updates. If an error is thrown by the servlet then it results in an alert() popup instead, describing the error. If the 'jxdebug' parameter was specified in the request then an alert() popup displays the pages updates that are going to be applied. Simplicity itself :)