I have been working on some personal projects using DWR. When it comes to web frameworks which are easy to work with, I haven't seen any that top this one. Besides the great "Getting Started" tutorial, there are also some examples around the web linked to here.

I believe that the biggest features of this project are ease of use and the separation between design and development it creates. The basic idea of DWR is to expose POJO as JavaScript objects for use on the client. Once you make a POJO available via the dwr.xml configuration file, you can import the resulting JavaScript source like this:

<script type="javascript" src="/dwr/interface/MyPojo.js">

The framework has many useful features such as:

  • Utilities to map data to callback script functions
  • Remote Call Batching – Similar to a Transaction of Remote Service Calls
  • Remote Call Ordering – Since AJAX is Asynchronous, this allows for Ordering the Responses
  • Error and Warning Callback Handler Functions
  • Remoting Pre and Post Hooks – These Hooks are Called whenever Remote Calls are Made or Finished
  • Access to Servlet Session Objects – Allows ExecutionContext.get().getServletContext()
  • Struts, Hibernate, and Spring Integration

A very important aspect to consider when using DWR is security. Since a user is exposing their Java code via generated JavaScript classes, you have to make sure that only your application is allowed access to these functions.

For those of you who are experienced in web design, JavaScript, and Java, I think that you will find this framework to be quite elegant.