Philip McCarthy has started a series of articles about implementing AJAX technology in Java applications. The first article is entitled Build dynamic Java applications and has been available since September 20, 2005. On October 04, 2005, the second article, entitled Java object serialization for Ajax was released. It provides details about five ways of serializing your objects for use with AJAX. In doing so, Philip provides a very useful overview of when to use which method. Way to go Philip! I am looking forward to your next article.
Certainly very interesting. Especially the use of JSON – available with all four methods by the way – looks very promising. I had not realized that JSON is a standard feature of JavaScript – an immensely compact way of defining an object and array structure. Any server side view – Servlet, JSP, etc. – can produce a text document that contains JSON based data. Absorbing that data from the responseText on the XmlHttpRequest object into the client side JavaScript variables is dead easy: var myObject = eval( “(” + req.responseText + “)”); will load the entire data structure that was sent in JSON notation in the HtppServletResponse in the JavaScript variable myObject.