Saturday 29 January 2011

How to use DWR (Direct Web Remoting) with Tapestry

Tapestry do have some excellent Ajax features, but still it is yet to have an efficient Reverse Ajax features which can help us develop very rich UI applications. DWR supports Commet, Polling and Piggyback. It's not straight forward to add DWR support to tapestry. So am listing few important points to remember while adding DWR to your Tapestry project.

Add ontributeIgnoredPathsFilter method to exclude dwr servlet calls from tapestry filters

public static void contributeIgnoredPathsFilter(Configuration configuration)
{
configuration.add("/dwr/.*");
}

Add init param activeReverseAjaxEnabled as true in web.xml

The web.xml entry should look like something similar shown below.










On the web page (.tml file) make sure you include the below java scripts









Last ,but not the least....make sure you add dwr.xml to WEB-INF folder and dwr.jar to the WEB-INF/lib folder.

Please let me know, if you still face any issues implementing DWR with Tapestry.

No comments: