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:

image

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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.