Try the Google Web Toolkit. It has some easy examples of AJAX programming with a java servlet backend.
Getting Started - Google Web Toolkit - Google Code

If your server takes too long to respond,...