"Ajax applications can seem magical at first, but the
process of developing the applications is straightforward,
thankfully. For every Ajax interaction, you must create an endpoint
(to borrow a term from our Web service friends) on a server and
client-side code to call that endpoint. You must also create all
the code for serializing the data going between the client and
server. These server endpoints can be generic services, maybe even
a RESTful one at that. However, they are more often very specific
to the needs of the client. Sometimes you should avoid tight
coupling, but sometimes you should embrace it. For the latter
cases, DWR is a turnkey solution. It lets you declaratively expose
server-side code as an Ajax endpoint, generating all the plumbing
for you auto-magically. Now, take a look at a specific example to
see how DWR works."