DWR aims to make using Ajax with Java easy.
DWR gets rid of almost all the boiler plate code between the web browser and Java code, making it really easy to call XMLHttpRequest and get results from the a Java servlet.
DWR does code generation to generate javascript based on a Java class. The web developer writes Java to run on the client, as if they were located on the server, and the code generation stiches things up with XMLHttpRequest to make this possible. Because of this model’s security implications, the server must be configured to only allow specific ‘safe’ Java classes that are to be used with DWR.
XMLHttpRequest, unlike a standard Java call, is not executed synchronously, so to resolve this difference, DWR exposes the ability for the web developer to specify callback functions they wish to use to be called when the results of code execution are returned to the client.