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" 

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.