WebSockets and HTML5 on GlassFish
By pelegri on Oct 13, 2010
Last week he showed a simple Web application that controls an HTML5 video object remotely (post). The example works using WebSockets connected from the server to two browser windows - playback activity in the master window is reflected instantaneously on the slave window. Simple code but helps understand how these features can be used.
This week Santiago created a screencast (HD) based on that example and posted it to GlassFishVideos. I just placed it in a HTML5 playlist together with an earlier video from Alexis on WebSockets support in Milestone 2 of GlassFish 3.1.
I'll use this opportunity to capture a few key links on this area, hopefully it will save you some time.
A good entry point is WhatWG.org, which includes the specs for Web Applications 1.0, HTML 5 and Web Workers and plenty of other good content like FAQ and Wiki. HTML 5 properly describes the document format and semantics (Wikipedia, WHAT's Editors Draft, W3C Editor's Draft). There are many HTML5 tutorials out there; I like Mark Pilgrim's Dive into HTML5 (avail under CC-BY-3.0 License).
Websockets (Wikipedia, API@W3C, Protocol@IETF) is the technology used in Santiago's example. Gregor Roth recently published a two part series that also covered WebSockets as well as Server-Sent Events, a higher-level API intended to manipulate the DOM from the server side.
Expect more HTML5 posts and videos; in the meantime, enjoy!