BT
x Your opinion matters! Please fill in the InfoQ Survey about your reading habits!

Presentation: Interactive Websites with Comet and DWR

by Abel Avram on Apr 08, 2009 | NOTICE: The next QCon is in San Francisco Nov 3-7, Join us!

In this session filmed during QCon London 2008, Joe Walker presents Comet, a long polling AJAX method used for updating the browser’s page, and DWR, a Java library for writing web sites using AJAX.

Watch: Interactive Websites with Comet and DWR (1 hour)

Comet opens a network connection and keeps it open indefinitely to allow the server to respond when it needs to. The server seems to be pushing data to the browser, but in fact it’s a long polled connection. This approach allows web servers to update pages when new information is available, and avoids the process of creating a new connection every time the browser wants to. Comet changes the HTTP request-response communication model into a server push one being useful for interactive pages. There are major web sites and applications using Comet: GMail, GDocs, Meebo, Yahoo! Mail, Jot and others.

Walker presents the benefits of using Comet and the difficulties they encountered in creating it. He also talks about DWR using code snippets. DWR allows “web browsers to securely call into Java code almost as if it was running locally.” DWR can also “marshal virtually any data including collections, POJOs, XML and binary data like images and PDF files.”

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Excellent! by Siva Prasanna Kumar

Excellent talk, but what about the number of open connections on the servers? Isn't their a limitation on that? Hmmm long back I had written a article about Server Push using Blaze DS, in that article we had to explicitly specify the user-agent based settings as shown below:

<user-agent match-on="MSIE" kickstart-bytes="2048" max-streaming-connections-per-session="3"/>
<user-agent match-on="Firefox" kickstart-bytes="2048" max-streaming-connections-per-session="3"/>


Do we need to do something similar in DWR also? My previous experience was with DWR 1.0, it was great but had some browser specific behaviors (had some issues with Mozilla, use to work great on IE). Never got a chance to look in to DWR 2.x, I think I will directly try DWR 3.0, when is it expected to release?


Thanks,

Siva Prasanna.

I've another idea by Hazem Salem

I used to implement comet using WCF (Dublex) over HTTP in real time applicaiton
We face a lot of challenges in implmenting it but we succefully overcome them all and the idea is running perfectly now.
Sive,
we succfuly overcome the problem of this max-streaming-connections-per-session="3"
Now no limits in using comet

I'm preparing to post our idea soon

Thanks

Comet on the rise? by Jurgen Huls

I think general Comet use is on the rise again. Its the new Ajax, lots of people seem to be using it now. We're starting to implement Comet features in to our social networking site using StreamHub Comet server. Like DWR, we can use our existing Java skillset so it suited us. It will be interesting to see how Comet grows in the future.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

3 Discuss

Educational Content

General Feedback
Bugs
Advertising
Editorial
InfoQ.com and all content copyright © 2006-2014 C4Media Inc. InfoQ.com hosted at Contegix, the best ISP we've ever worked with.
Privacy policy
BT