What is the best technique to guarantee that these two players are able to play interactivately,
that means player 1 sees the changes of player 2immediately and both can react simultaneously ("real-time communication").
I guess, AJAX (DWR, Direct Web Remoting) is too slow.
So should I go for WebSockets or XMPP or JMS(Java Messaging Service) or SERVLET API 3.0 (with its "COMET-API")
or is there another techinque which is the right thing for that kind of web-application?
actually I am trying/learning WebSockets by using JETTY-Servlet-Container
(which has built-in support for WebSockets).
Unfortunately, there is no XMPP-Server-Support for any Servlet-Based-Container
(such as Tomcat/Jetty, JBoss, Glashfish,..), so I need to have an additional XMPP-Server
(http://www.saint-andre.com/jabber/jsc/) running simultanously with my JETTY.
That is annoying. So I guess, I do not use XMPP and use WebSockets instead.
Have you *proven* that Ajax doesn't work they way you need it to?
I have been using ajax quite often without problems.
However, I want to give a try to use WebSockets or XMPP instead of Ajax (or Comet)
as I want to have a web based real-time-application.
I believe there is a misunderstanding here. WebSockets is not a replacement or a better Ajax. You should look at WebSockets the same way you look at a TCP socket. Instead of coding against the WebSocket APIs directly, you should use a protocol client such as XMPP that has been built on top of the WebSocket API. This will let you communicate directly with the XMPP server from the browser via a WebSocket-enabled server (if the server has been properly designed).
A demo example of how this can be done you can see here - http://www.kaazing.me This site shows how you can use XMPP over WebSockets to communicate with Google Talk (hint: use your Google account to login and chat).