I am newbie to vaadin. I have few questions:
Does Vaadin 7 or later version supports websockets?
Does Vaadin has any other features like pushing data from server to client (e.g. websockets)?
I am newbie to vaadin. I have few questions:
Does Vaadin 7 or later version supports websockets?
Does Vaadin has any other features like pushing data from server to client (e.g. websockets)?
Vaadin support Atmosphere, so google to get the plugin that will enable websockets.
Server push is the main feature coming with Vaadin 7.1 in a few weeks time. See the Roadmap for current status and the related blog post.
The most downloaded add-on for server push before Vaadin 7.1 is ICEPush but you can find other alternatives in the add-on directory as well.
Both of the other answers by jfarcand (creator of Atmosphere) and Ludd were correct, but are now outdated.
Vaadin 7.3.7 (as of 2015-01) now incorporates the Atmosphere library. Atmosphere provides for built-in support of Push. No need to add any jar, library, plugin, nor add-on. Vaadin Push first tries to use WebSocket technology. If not available, Vaadin Push falls back to other approaches.
Three simple steps:
@Push
annotation to your UI subclassScheduledExecutorService
to update data for your app in the background. Probably best to start and stop the executor service in a ServletContextListener
, called as your Vaadin web app launches and shuts down.Instead of Step # 2, you might want one user’s main user-interface thread to update another user’s display. Basically the same idea, and covered in the Book Of Vaadin.
See section 11.16 in The Book Of Vaadin for more info about Server Push.
In 2015-01, I posted this answer for a minimal example of Push in Vaadin 7. You can copy the content of a single file, to replace your the content of the MyUI
class in a new default Vaadin project.