A chat sample using Spring MVC 3.2, Servlet-based, async request processing. Also see the redis branch for a distributed chat.
There is a bug in Tomcat that affects this sample. Please, use Tomcat 7.0.32 or higher.
Eclipse users run
mvn eclipse:eclipse and then import the project. Or just import the code as a Maven project into IntelliJ, NetBeans, or Eclipse.