previous | index | next

Direct Web Remoting

Direct Web Remoting (DWR) is an open-source project that allows beans on the server to be associated with Ajax JavaScript objects.

Using DWR, the protoype call above can be replaced by a DWR call:

   function zipChanged(zip) {
       if(zip.length != 5) {
           clearCityAndStateFields();
       }
       else {
           // A DWR call. See /WEB-INF/dwr.xml
           ZipCodes.getCityAndStateForZip(zip, processZipCodeSelection);
       }
   }
without having to write a servlet.

previous | index | next