Thursday, November 10th, 2005

Ajax with Direct Web Remoting (DWR)

Category: Java, Toolkit


Philip McCarthy has another article over at IBM developerWorks. This time it is on Ajax with Direct Web Remoting.

Exciting as it is, adding Ajax functionality to your applications can mean a lot of hard work. In this third article in the Ajax for Javaâ„¢ developers series, Philip McCarthy shows you how to use Direct Web Remoting (DWR) to expose JavaBeans methods directly to your JavaScript code and automate the heavy-lifting of Ajax.

The article walks you through an example, a minimal model based on an online store.

Exposing Remote Calls

The magic of remoting with DWR is mainly in the XML config.

  "-//GetAhead Limited//DTD Direct Web Remoting 1.0//EN"
    <create creator="new" javascript="catalog">
      <param name="class" 
      <include method="getItem"/> 
      <include method="findItems"/> 
    <convert converter="bean" 
      <param name="include" 

Related Content:

  • Ajax apps with DWR
    A newly released podcast covers Ajax and Direct Web Remoting (DWR) including inside tips on using the Java open source library. It also covers common...
  • Using DWR with TIBCO General Interface
    This simple request/response cycle example demonstrates some of the basic utilities Direct Web Remoting (DWR) provides for making interactions between...
  • Critical flaw in Web 2.0, AJAX
    Fortify Software warns in a new report that digital outlaws could use JavaScript to snatch data from Web 2.0 and AJAX-based applications if they're...
  • Ajax Learning Guide
    Are you a Web developer? The time has come to rethink your entire approach to developing Web applications. Find out about the Ajax approach...
  • Ajax security concerns you need to be aware of
    As developers implement Ajax and Web 2.0 applications, they need to understand security issues such as cross-site scripting (XSS), cross-site request...

Posted by Dion Almaer at 12:03 am

2.9 rating from 7 votes


Comments feed

I don’t know…

I never feel safe exposing server-side methods to JavaScript. Unless you have a documented API for users (did this once with SOAP – don’t ask) and structure it to accept that the users will control server-side parameters, you’ve just opened up a wealth of injection and DOS opportunities.

Not saying it can’t make some cool apps, just saying you’d better do it right the first time.

Comment by Shawn — November 14, 2005

i want to know a few details from u .
1). how we can do client side validations using DWR.
2). how i can populate values in dropdowns, where i am getting values from database.

let me know these few things as soon as possible.

thanks & regards,

Comment by ramu — August 14, 2007

Leave a comment

You must be logged in to post a comment.