Direct Web Remoting (DWR)

We’ve seen how JavaScript libraries can greatly reduce the amount of JavaScript code you need to write to implement Ajax functionality in your applications. For example, earlier in this short cut, we replaced approximately 30 lines of handcrafted JavaScript with a single call to the Prototype library:


In the preceding code fragment, we execute an Ajax GET request with the URL dateAndTime.ajax. When the request is complete, Prototype updates the inner HTML of the dateDIV with the response text. Can things possibly get easier than that?

In fact, they can. Remember that although the JavaScript in the preceding code fragment ...

Get AJAX and JavaServer™ Faces now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.