With Vaadin Framework, create stunning Web UIs with plain Java

Share this post:

Vaadin Framework is a tool to build good looking Web apps without working with low-level Web technologies. The framework itself contains all the logic to create the modern Web app while you concentrate on the UI itself, using a familiar component based approach, almost like you’re building a traditional desktop app. In this article, we’ll look at two alternatives, along with really trimmed down examples, and a how-to-get-started with Java Web apps in Bluemix from scratch.

Screen shot collage of Vaadin Framework DashboardThe screenshot above is from the Dashboard demo.

Vaadin apps can be run in Bluemix easily, as Vaadin basically just requires a servlet container, like the WebSphere Liberty Profile which is available in Bluemix. We have previously covered using the Vaadin boilerplate application example, which builds on Java EE architecture, uses EJBs and JPA to access a traditional relational database. But not all apps need that kind of “enterprise grade” architecture.

Let’s get started!

Using the Vaadin Maven archetype

Vaadin logoThe first thing you will need to do is register for Bluemix, if you don’t already have an account. There is a 30-day free trial you use for the purposes of this blog article.

All IDE integrations in Vaadin are now based on Maven archetypes, which practically create for you the basic build scripts to create a war file and a simple “hello world” example code. The first step is to create such a project using our getting started instructions. Feel free to use either command line in the Maven or IDE approach.

Once you have the project ready and you have built the war file, you’ll need to push the WAR file to Bluemix. An easy way to do is with the Bluemix/CloudFoundry CLI tools. Unless you have already done it, follow the instructions on how to install and login to your account. Then, after the login, you can just apply the following command from the projects root directory:

cf push your-server-name -p target/*.war

Note that if you are using Windows, replace the star character with the exact name of the generated war file.

If you want to simplify the subsequent push commands to update your app, create a manifest.yml file with the following content:

– name: your-server-name
path: target/your-war-file-name.war

Then, updating the app simply happens with the “cf push” command.

Starting with

Spring Boot is a new and interesting approach to building Java web applications. With it, you’ll not only create a traditional war file (at least by default), but a jar file which embeds the Web server as well. So instead of feeding Bluemix with a war file, which is then given to a Java Web server, you’ll push that jar file. The “buildpack” in Bluemix is smart enough to handle both war files and jar files.

To create and deploy a Spring Boot-powered Vaadin app to Bluemix, first create a project using, create a simple Vaadin UI and build the jar file. See the beginning of this introduction webinar if you need more help to get started with Spring Boot and Vaadin.

Once you have the project built, the command to deploy and update the app is almost the same as with war packaged web apps:

cf push your-server-name -p target/*.jar

When Bluemix receives the jar file, it automatically figures out it should launch this file using “java -jar your-app.jar” command, instead of creating a Liberty server and deploying the app there. Naturally, you can create a similar manifest file as with war files to simplify the process.

What next?

Now you have the basics set, the rest is just plain Java development. If you want to learn more Vaadin development, the best resource is the Vaadin tutorial. Then just use your Java skills and the huge amount of available Java libraries to implement the application of your dreams.

Sign up for Bluemix and get started with Vaadin apps. It’s free!

More How-tos stories
May 7, 2019

We’ve Moved! The IBM Cloud Blog Has a New URL

In an effort better integrate the IBM Cloud Blog with the IBM Cloud web experience, we have migrated the blog to a new URL:

Continue reading

May 6, 2019

Use IBM Cloud Certificate Manager to Obtain Let’s Encrypt TLS Certificates for Your Public Domains

IBM Cloud Certificate Manager now lets you obtain TLS certificates signed by Let’s Encrypt. Let’s Encrypt is an automated, ACME-protocol-based CA that issues free certificates valid for 90 days.

Continue reading

May 6, 2019

Are You Ready for SAP S/4HANA Running on Cloud?

Our clients tell us SAP applications are central to their success and strategy for cloud, with a deadline to refresh the business processes and move to SAP S/4HANA by 2025. Now is the time to assess, plan and execute the journey to cloud and SAP S/4HANA

Continue reading