|
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 (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 → → . 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:
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 → . All settings in the popup ought to be OK so just click . 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. NoteIf 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. NoteThe 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 NoteIf 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. NoteNote: 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: |