![]() |
|||||||||||||||||||||||||||
|
| |||||||||||||||||||||||||||
An Introduction to (Ajax) Ben Galbraith and Dion Almaer, founders of Ajaxian.com, spoke to an enthusiastic crowd on Tuesday afternoon during their session "An Introduction to (Ajax)" (TS-4489). Using simple but effective examples, the two made a compelling argument for using Asynchronous JavaScript with XML (AJAX) to create dynamic, responsive applications that are easy to deploy and that require nothing more than a common web browser. (Ajax) represents a new way to process data in web pages, making it possible to update portions of a page rather than the entire page. Microsoft introduced parts of the technology in Internet Explorer as early as 1997, and Mozilla reproduced the functionality later in 2002. Most updated and current browsers support AJAX. Of course, JavaScript technology is at the heart of (Ajax). JavaScript is a scripting language that developers used in the past to create interesting mouse roll-over behaviors, to animate buttons or backgrounds, and to perform minimal error checking of HTML form data before sending the form to the server. Those abilities are simple, even trivial, compared to what Ajax can do. Providing much more than visual manipulation of page components, (Ajax) allows interactive requests and responses between a browser and a server, updating only those portions of a page that require it.
At the heart of (Ajax) is an object called (Ajax) applications can get several kinds of data back from a server:
Galbraith and Almaer tried to dispel several (Ajax) myths during their presentation: Myth number 1: (Ajax) is hard.
The HTML file that the presenters used in their demonstration contained two text fields: a city and state field and a zip code field. After reading a zip code that the user typed into the first field, Galbraith and Almaer's (Ajax) code constructed an Myth number 2: Cross-browser differences are difficult to manage.
Unfortunately, different browsers implement the functionality of Myth number 3: If you want rich effects and widgets, desktop applications are a better choice than (Ajax). Technologies such as JavaServer Faces provide rich, usable graphical components that you can manipulate and combine with (Ajax) code to provide interactive, visual experiences similar to those available from desktop applications. Myth number 4: Off-line modes of operation are impossible. They are definitely not impossible. The availability of embeddable Java technology databases such as Apache Derby allow developers to cache pages and data necessary for many off-line uses. Myth number 5: Client-side validation is a pain. There are so many libraries available that many common validation scenarios have well-tested, accessible solutions. Moreover, (Ajax) provides the ability to validate data across the network with little or no delays in the user experience. For example, a popular library called Direct Web Remoting (DWR) can assist with cross-network data validation. What can (Ajax) do for your browser-based application? (Ajax) can increase participation. Because users don't have to wait for page reloads or jump to other pages every time they interact with your site, they are more likely to answer questions and rate products, for example. It can improve portals and forums. Specific portals areas on a page can update themselves without entire-page refreshes. Content stays fresh. It provides rich client-side validation. As you experiment with (Ajax), remember that you don't have to write all your own code. The many existing Ajax frameworks can simplify your project code and save you time. Some of the most popular libraries and frameworks are the following:
Given the excitement around and capabilities of (Ajax), should you abandon the Java technology, rich-client desktop? Absolutely not. Both Ajax and desktop technologies have their advantages and disadvantages. You might consider the following points when deciding where AJAX fits into your development plans:
Lots of (Ajax) sessions are available at this year's JavaOne conference. Remember to register and check for session changes using the JavaOne ScheduleBuilder. The following sessions, labs, and Birds-of-a-Feather (BOF) sessions may interest you:
(Ajax): Riding the Web Application Horse a Little Further (LAB-4255)
Java Technology, (Ajax), Web 2.0 and SOA (TS-4372)
Using the Dojo Toolkit to Develop (Ajax)-Enabled Java EE Web Applications (TS-3577)
Smackdown for (Ajax) Programming Models and Frameworks (TS-2991)
Java BluePrints Application: Creating (Ajax)-Enabled Web 2.0 Java Pet Store Demo Software (BOF-2594)
Evolving JavaServer Faces Technology: (Ajax) Done Right (TS-116)
Introduction to (Ajax) (TS-4489)
(Ajax) and Persistence: Emerging Patterns and Pain Points (TS-8614)
Introduction to (Ajax) (TS-4489)
JavaServer Faces, (Ajax), and Portlets: Developing Apps Without Distress (TS-6877) More information about JavaScript technology and (Ajax) are available from the following sites:
Ajaxian
(Ajax) Developer Resource Center
JavaScript Technology | |||||||||||||||||||||||||||
Comments | About
Sun | Privacy | Terms
of Use | Trademarks | Third
Party Content Disclaimer Conference content is subject to change. Copyright 1996 - 2006 Sun Microsystems, Inc. |
![]() |
|