Ajax using XML Http Request and Struts

ADVERTISEMENT


About five years ago I worked on a web app project where one of the primary requirements was that it should look, work and feel like a Windows-based fat client. Now, ignoring the question of why it was not in fact done as a Windows-based fat client in the first place, that can be a rather tough requirement in the world of web development, certainly it was five years ago when not very many examples of such a thing existed.
As a result of a number of proof-of-concepts, I stumbled upon some techniques for doing things that were at the time rather atypical approaches to web development. The end result was an application that, to this day, many people cannot even tell is web-based, aside from the fact that you access it with a browser!
Little did I know that only a few years later the basic concepts behind what I had done would re-emerge in the world as something called Ajax. Ajax is a term coined by the folks at Adaptive Path and is shorthand for Asynchronous Javascript + XML.

This just goes to show, patenting every idea you ever have is indeed a good way to riches! If only I would have thought what I did was anything special! But I digress…
Google is doing it. So are many others. But what is it? In a nutshell, the Ajax concept, which is not a concrete technology implementation but rather a way of thinking and a set of techniques that go along with the mindset, is concerned with the idea that rebuilding a web page for every user interaction is inefficient and should be avoided.

For instance, say you have a web page with two <select> elements on it. You want the contents of the secondone to change when a selection is made in the first. Something like this is not uncommon and there are a number of ways you can handle it. The Ajax approach to this is to only redraw a small portion of the web page, namely the contents of the second……

The Ajax concept is based around something called the XMLHttpRequest component. All you Microsoft haters get ready to yell because this was a Microsoft creation! Yes, Microsoft got something right, and did so before anyone else! Microsoft first implemented the XMLHttpRequest object in Internet Explorer 5 for Windows as an ActiveX object (ok, so they didn’t get it QUITE right!). The Mozilla project later implemented a native version with the release of Mozilla 1.0, and by extension, Netscape 7. Apple has now done the same as of Safari 1.2. Opera is now following suite with their version 7.60. All released versions of Firefox contain it as well.

Let’s just cut to the chase and get to some code, shall we?
The XMLHttpRequest component, being a client-side component, must be instantiated via scripting before it…………


Download Ajax using XMLHttpRequest and Struts.Pdf:

[smartads]
Download file

One Response to “Ajax using XML Http Request and Struts”

  1. [...] their various implementations) have characteristics of more than one group. For example, DHTML with XMLhttpRequest (commonly referred to as AJAX) is part thin client and part Rich Internet Application (RIA). [...]

Leave a Reply


Map: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67