Saturday, August 11, 2012

Create First Vaadin Application

Let us create a simple Vaadin application(survlet/portlet) using eclipse IDE. First configure vaadin with eclipse. For more details Configure Vaadin Environment for Eclipse IDE


Open eclipse File->New->Other (Ctrl+N) Type vaadin and you can see the following wizard


Select Vaadin Project -Next
In the new project wizard enter details
  • Project name: Enter project name
  • Target runtime: Select a server if you have already configured otherwise select none. 
  • Vaadin deployment configuration: Servlet(default), select portlet if you want to create portlet
  •  Click on Next-Next, if you want to change application name, display name then change it and click on Finish


Configuration for tomcat server on eclipse 

  • Go to Window-Preferences-Servers-Runtime Environment there click on Add in right panel and add your tomcat folder. After that click on finish. 
  • Open Window-Show View-Servers window.
  • On Servers window right click and click on New-Server and select server which is already configured. 
  •  Now right click on server which is been added just now and click on Add and Remove then select first vaadin portlet and add it. 
If you know how to deploy an application on tomcat just ignore above steps and deployt your firstvaadin project on tomcat.

Done....

You have created Vaadin servlet now. Type http://localhost:8080/firstVaadin
You can see default content(Vaadin label with a text 'Hi Vaadin User') which is already added.
Done...

Some times you may face following warning while creating project. It is because eclipse is unable to download/setup gwt-dev.jar file by default. In such cases we can setup manually.

 Vaadin libraries installation failed
 Failed to add Vaadin jar to project
 Failed to download gwt-dev.jar from http://vaadin.com/download/external/gwt/2.3.0/gwt-dev.jar

To install vaadin libraries manually go through this post : Configure Vaadin Libraries Manually

No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...