A small example on how to use EventSource aka Server-Sent Events with Java.
You need jetty-eventsource-servlet (released to Maven Central) then go to http://127.0.0.1:8080/event-source-sample/ and you see the server time that gets updated all ten seconds. Not very useful but shows you how to use the API.
To make the example work on Tomcat you need Tomcat 7 and have a NIO connector.
<Connector protocol="org.apache.coyote.http11.Http11NioProtocol" />
Check out the the HTTP Connector reference for more information.
It's recommended that you use Tomcat 7.0.28 or newer otherwise you'll get chunking.
Does chunking but works out of the box.
Needs a not yet released version or a manual patch, see GRIZZLY-1252
Works out of the box, even on Jetty 7.