Embedding Vaadin in a desktop app

We are interested in using Vaadin as the user interface for an (already existing) Java desktop application (which will launch the web browser and point it to a local embedded web server, which will serve up Vaadin). Eclipse is our development environment.

Unfortunately, it seems that most of the documents assume that Vaadin is being used to build a web-app, and thus assumes that the application has a “war”-type structure, which is obviously not appropriate for us.

Can anyone recommend how best to embed Vaadin in a desktop application? I assume we’ll need a lightweight servlet container, perhaps someone can recommend something appropriate along with how we should configure it.



Vaadin is a web-framework and therefore the WAR-structure (Web ARchive) is required - as with all Java-Webframeworks. You could use an embedded Jetty for example, deploy your vaadin-app(-part) to it and start that using your desktop-application. But as a whole, your architecture looks a bit questionable - think of the usability-gap between web- and desktop-applications, the look and feel etc. Also Vaadin is mimicking a desktop-fat-client as good as possible, there are still a lot of differences the user will definitely notice.

Thanks for your response.

We’ve evaluated a bunch of options for building a Desktop UI, and everything we’ve found is lacking in one way or another. Swing simply doesn’t look good no matter what L&F you use, SWT requires native components which would complicate our build and deployment, ditto for QT, and so on.

It seems that there are very few options for creating a Java desktop UI that can match contemporary non-Java UI standards. Vaadin looks like it might be good enough. Yes, there are some differences between desktop apps and web apps, but everyone is familiar with how web apps work, and they are perfectly accustomed to using them within a web browser on their current operating systems - so I really don’t see where this “usability gap” comes in. A web-like UI will be more familiar to most users than a Swing UI, for example.

If you’re interested,
are our notes on the various options for building a Java Desktop UI, I’d appreciate any feedback you have.

If you are building a brand new application, why don’t you make it fully web based?

Ah, ok, I read your message like “We already have a desktop-application (with GUI) and want to do an addition to it using Vaadin” - that’s where my concerns are coming from. After rereading your posting, I understood what you are actually doing …

Well first question: Why don’t you do the whole app web-based then? Makes it normally easier to maintain.

I read your wiki-document and have to say, well if you don’t like all the desktop-UI-stuff the Java-universe provides (and I fully understand that), then Vaadin will be a good match. It is very usable for any kind of “app-like” UI and provides all important widgets out of the box. Regarding the build-process you should keep in mind that it won’t be really easier than for example GWT, at least as soon as client-side-addons are coming into play. In that case you will have to do some widgetset-compiling, which will be one more step to your build-cycle.

It’s a P2P app, so it has to run on the user’s own computer.

Thanks Tobias.

We can’t do the entire thing as a web app because it is a peer-to-peer application, basically a decentralized anonymous microblogging system (similar functionality to Twitter). It’s designed for use in countries like China and Saudi Arabia, as a way for democracy activists to exchange information without fear of censorship. Because of this, doing it as a simple web app would defeat the point, I’m afraid.

Regarding build process, do you think it is likely that we would need client-side-addons for our application? (our goal is that our UI will be quite similar to Twitter’s).

If anyone is interested in learning more about our plans, please see https://github.com/sanity/tahrir/wiki

Why China and Saudi Arabia, only? I have been told that the occupy movement in NYC needs tools like that, though I admit I have not investigated further. Personally, as a (proud) member of demandprogress.org I very much worried about the situation in North America, freedom of speech is of paramount importance in my book.

I have been thinking on and off about embedded webservers as viable gui alternativse for almost a decade, started in the context of my own fork of Shareaza some years ago. I see much potential in Vaadin in that context. I remember reading about successful Vaadin deployments following that line of thought.

I was a bit surprised to see Ian posting here, I highly respect his work, especially Swarm which was nothing less than awesome from a geek’s point of view :slight_smile: I couldn’t help it but wonder if I could be of help…

You can do almost everything with core-Vaadin without using client-side-addons. For a more sophisticated UI it can be helpful. But actually it isn’t that hard to get this step integrated into an build-process, as it is (more or less) just an Ant-file you need to run.

Youlian, It’s not limited to China and Saudi Arabia, those were just two example countries where the Internet is censored.

I’m very flattered, thank you :slight_smile:

That’s good to know, I hope we can avoid having to do any client-side addons. We are using Maven as our build tool, and I’d rather not complicate our build process any more than it already is :slight_smile: