Vaadin 7.1 Beta out now


What a nice way to start a new week. The Vaadin build process was successfully completed on Friday and we have now a new minor (beta) release: Vaadin 7.1 Beta1 is available in Maven Central and on the download page.

Those of you who have been following Vaadin development lately already know that this is most prominently about the server-push. It is the feature to make your applications more server-driven than before - real-time, background processing, asynchronous, and more collaborative.

Even if you are not interested in creating asynchronous server-driven applications, there are still new features in 7.1 that might be interesting to you. The Calendar add-on has now been integrated into the core framework and there is now Page.getCurrent().getStyles() for injecting your own CSS for the components, a completely new debug window, and the possibility to optimize widgetset size.  For more details, please consult the release notes for the beta release here.

Your first push application

From a programming point of view, one should keep in mind that writing multithreaded applications is also a bit more complicated than writing single user, single threaded ones. We have tried to make it easier by providing some API for this. A couple of  important pointers:

  • XHR (or HTTP request-response) is still the default communication channel and to use server push you must enable it first. Take a look at the tutorial here:

  • Lock the UI instance when updating the content. There is UI.access(Runnable) method for doing this. Just remember to minimize the work done inside this Runnable to avoid performance problems.

  • ThreadPoolExecutor.submit(Runnable) is a simple way to run asynchronous tasks, but different Java EE servers may provide other Thread pooling mechanisms.

  • Vaadin 7 leverages Java asserts to give you some development time information. This is helpful in finding logical mistakes like thread deadlocks, etc. Use the command line option -ea to enable asserts in your JVM.

  • The push implementation is based on Atmosphere framework and you can find compatibility information here.

We still have some known limitations, but Vaadin 7.1 Beta should now be a good starting point for development of applications that need real-time updates fired from the server. Of course, your imagination is the limit, but to help you get started, here are some push-enabled Vaadin application prototypes we have made previously:

And surely there is more to come soon...

FAQ: The most common problem is that you try to update the UI from an another thread without using the UI.access method. Like,
Posted on 5/6/13 1:14 PM.
Hi, Nice to see Push support.
Are there some Best Practice or thoughts to deal with threadlocal vars.
e.g. SpringSecurity uses this (and other) Atmophere on Tomcat (with or without servlet 3.0 async) do not call filters on websocket connection.

I am curious how to deal with this, maybe there are some thoughts about it.
By the way, i am not dig deep to push so maybe there are some handlers, callbacks, listeners or something - short google does not find infos about it.
Posted on 5/8/13 12:27 PM.
The linkes example Chat application throws exception
Posted on 5/11/13 8:26 AM.
Unfortunately the chat application currently responds with error 500
Posted on 5/24/13 8:18 AM.