High Level Overview
AJAX is the buzz-word of the moment to web developers. It's a buzz-word that is hotly debated from many angles, but it has stuck as a buzz-word because it encapsulates something that is new from a user's perspective. The functionally that is newly available to all web users is "in-page replacement" - the ability for a web page to change using data from a web server without totally redrawing itself. This functionality has been around in Mozilla and Internet Explorer for a while, but it is only recently that Safari and Konqueror users have been able to join in.
It is this ability to have web pages that change dynamically that is changing the way users interact with the web. For example:
| Old Style | AJAX Style | |
|---|---|---|
| Scrolling in a mapping website | Click on right arrow to refresh whole page | Drag map area to the right - and watch the map scroll. (see Mapping in resources) |
| Lookup a word in a dictionary | Enter the word, and click submit to see a definition for that word | Begin typing the word, see possible matches as you type and the definitions as soon as you finish typing. (see Dictionary in resources) |
| Interact in on-line forum | Type message, click submit, regularly click "check new messages". | Type messages, and wait as new replies appear automatically without needing your interaction. (we will create a site like this) |
| Fill out form with a number of fields | Visit a number of pages of a "wizard", getting error messages about invalid fields. | Fill out a form which reports on errors as you type, and which can dynamically add data (like filling in full address details from a zip code) without needing a slow page refresh. |
AJAX isn't the best acronym in the world - it stands for "Asynchronous Javascript and XML". This does nothing to describe the benefits to a user: the technology behind it does not have to be asynchronous, and the best implementations don't use XML either. However the buzz-word has stuck so we are better off going with the flow now.
The problem for the web developer is that while this is a very attractive way of creating web-sites, and one where you can get started without a huge amount of effort, there are a number of pitfalls which can make life harder for them. All of the browsers have different quirks, so you can easily discover that you have locked Mac users out of the party.
It is also worth checking out Matt Raible's blog where he has an excellent movie demonstrating advanced use of DWR.
For more information about Ajax in Java see the overview of DWR, the getting started guide and download instructions.