Wednesday, July 16, 2008

Cometd, Tomcat and Jetty - the road to server push

I have managed to "Hello world" the cometd Java implementation following this guide and hacking away. No it didn't work out of the box, if you want to get it working also look at the comments and specifically the one made by "erkulas" (me).

I just had to implement a ultra-simple chat application as soon as I got things working. In fact it took about 3 lines of Javascript code and a Cometd server running on Jetty running in Tomcat. Thats actually very impressive IMHO. With just basic knowledge of Eclipse/Java and a few JAR-s you can make a chat application that runs directly in browser with 5 lines of Javascript code and within 5 minutes.

The the demo that I prepared is here . Just launch 2 or more different browsers (IE and Firefox and Opera) and go to this URL. Everything you type in one browser will be visible in another with Cometd pushing the data to every browser.

No comments:

Post a Comment