12.07.2015 Views

Beginning Java EE 6 with GlassFish 3, Second Edition

Beginning Java EE 6 with GlassFish 3, Second Edition

Beginning Java EE 6 with GlassFish 3, Second Edition

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

CHAPTER 12 ■ PROCESSING AND NAVIGATIONXMLHttpRequest object, which is now supported by most browsers. At the same time, several companiesbrainstormed about how to ensure that Ajax could be the industry standard for a rich applicationplatform based on open technologies. The result of this work was the creation of the OpenAjax Alliance,which consists of vendors, open source projects, and companies using Ajax-based technologies.As shown in Figure 12-7, in traditional web applications, the browser has to ask for the full HTMLdocuments from the server. The user clicks a button to send or get the information, waits for the serverto respond, and then receives the entire page that the browser loads. Ajax, on the other hand, usesasynchronous data transfer (HTTP requests) between the browser and the server, allowing web pages torequest small bits of information (JSON or XML data) from the server instead of whole pages. The userstays on the same page while a piece of <strong>Java</strong>Script requests or sends data to a server asynchronously, andonly portions of the page are actually updated, making web application faster and more user friendly.Figure 12-7. Plain HTTP calls vs. Ajax HTTP callsIn principle, Ajax is based on the following:• XHTML and CSS for presentation.• DOM for dynamic display and interaction <strong>with</strong> data.• XML and XSLT for the interchange, manipulation, and display of XML data.• The XMLHttpRequest object for asynchronous communication.• <strong>Java</strong>Script to bring these technologies together.369

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!