Vaadin

Join Vaadin Log In

Before we get started we need to setup the following things:

First you need to install the Vaadin Eclipse plugin in Eclipse. Detailed instructions are available at http://vaadin.com/eclipse/ . The address of the update site is the same, http://vaadin.com/eclipse/ and you need to install at least Vaadin Eclipse Integration (feel free to install the others too although they are not needed for this tutorial).

Restart Eclipse after the plugin has been installed and create a new project by selecting FileNewProject. Select "Vaadin Project" which is designed to build Vaadin web applications deployed as a .war file to a servlet container.

You need to do the following changes to the defaults:

  • Enter a Project name
  • Select your target runtime, or if you do not have any installed:
    • Choose new
    • Select Apache Tomcat v6.0
    • check Create a new local server
    • Choose your Tomcat directory in the next step
  • Click Finish and switch to the suggested Java EE mode

The project creator now automatically creates a proper hierarchy for our project and generates the deployment descriptor (web.xml) for the project. The required Vaadin library is also downloaded and added to the project. Additionally an example Vaadin application (AddressBookApplication) is created.

We are now ready to deploy our project to Tomcat and test that everything works. Right click on the AddressBook project in Project Explorer and choose Debug as Debug on Server. All settings in the popup ought to be OK so just click Finish. Eclipse will now deploy the project, start Tomcat and start the embedded browser and show the application. At this point it should only show you a "Hello Vaadin user" text.

Note

If you just see something like "The requested resource is not available" go back and recreate the project and make sure you have selected "Vaadin Project" in the configuration select.

Note

The Vaadin Eclipse Integration plugin creates the deployment descriptor automatically for you and also updates it when you change the project. See the Reference Manual if you want to know more about what the web.xml file contains.

We can set breakpoints as in any other Eclipse project by double clicking in the left margin e.g. next to the init() method in AddressBookApplication . Restart the server and open the application again and you will see that the debugger jumps in before the application is shown.

Note

If you just see something like "The requested resource is not available" go back and recreate the project and make sure you have selected "Vaadin Project" in the configuration select.

We are now ready to start building the main layout of our application. If you experienced a problem, go back and recheck the steps or download the Eclipse project for the next step (http://vaadin.com/download/current/docs/tutorial/projects/ab-ch2-setup.zip) and start from there. The Book of Vaadin also contains instructions on how to get started.

Note

Note: After this step we have done ALL the needed configurations to start developing Vaadin applications. No more libraries needed, no more XML configurations needed whatsoever - no matter how much you extend your application in the future.

You can download the Eclipse project package for this step from: