Tuesday, December 16, 2008

Ajax + Dwr

Dwr is a framework for Ajax developers. It is easy to use.

Refer the site for more


Dwr Xml


<blockquote><?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE dwr PUBLIC "-//GetAhead Limited//DTD Direct Web Remoting 0.4//EN" "http://www.getahead.ltd.uk/dwr/dwr.dtd">



<create creator="new" javascript="ViewDataJS">

<param name="class" value="com.hylafax.view.ViewData"/>


<convert converter="bean"




in dwr xml, create tag creates a new js object of a java class. here "ViewData" java class has been converted to a "ViewDataJS" js script.

convert tag is used to convert object types to js. here "SentDetail" java class objects are converted.

In your jsps


<blockquote><script type='text/javascript'


<script type='text/javascript'


you have to add dwr jar file to your project. after that you can call your js methods which are in your java class.

you can access your script urls by typing :


here Test is your project

calling methods in java class


you can call methods like this


here "division" is the prameter for the getReceiveList method. you can get the results with gotBReceivedFax method.

No comments:

Post a Comment