Java EE 7 is out now and so I was curious to play around with the new specifications and APIs from in this technology stack.
That’s why I didn’t hesitate to add yet another websocket-chat tutorial to the existing ones on the internet in favor of gathering some experience with this technology and a possible integration using a GlassFish 4 server, the new Java API for JSON Processing for data serialization combined with custom websocket encoders/decoders and finally adding some Bootstrap and jQuery on the client side.
The HTML5 working draft describes different techniques to push information from a server to the client and the one described in this tutorial are Server-Send Events (SSE).
Using Server-Send-Events eliminates the need to poll a server periodically for information using AJAX and is really easy to implement because of the simple specification and the fact that nearly all modern browsers already implement this specification.
Some funny stuff can be done using HTML 5, canvas elements and the video events API.
In the following example we’re using these techniques to apply graphic effects to a video embedded in a HTML page..
CoffeeScript is nice but a vivid integration into our application build lifecycle with Maven is better and that is what the following example is all about.