JSR-356 & 353 (WebSockets & JSON) might be of interest, instead of Ajax. You can keep a socket open for the whole session and just pass javascript messages back and forth. A few annotations and you're good to go.
They're part of the JEE standard now.
They're part of the JEE standard now.
Comment