|
Eager to start developing you own applications using Vaadin? This section presents a QuickStart into running and debugging Vaadin demos under Eclipse. The QuickStart includes a web server, so you do not need to have a full-weight web container such as Apache Tomcat installed. If you have followed the instructions given in Section 2.2, “Setting up the Development Environment”, you can start Eclipse by running When starting Eclipse for the first time, it asks where to save the workspace. You can select any directory, but here we select Close the Eclipse "Welcome" -screen when you are ready to continue. If you have not yet downloaded the Vaadin package, instructions for downloading and unpacking are available at Section 2.1.1, “Installing the Distribution Package”. The installation directory of Vaadin contains all necessary files to allow importing it as a ready-to-run Eclipse project:
Once the project is imported, as described above, you can run the Content Browser, including the demo applications, as follows:
Note that after the application has been launched once, it appears in the Favorites list. You can then click on the small dropdown arrow on the right side of the button on Eclipse toolbar and select . ![]() Running the application in Web Mode will start an embedded web server and open a browser window with the Content Browser. The default system web browser is opened; make sure that the browser is compatible with Vaadin. The Console view in the lower pane of Eclipse will display text printed to standard output by the application. Clicking on the red button will stop the server. Note that executing the web application locally may cause a security warning from your firewall software because of the started web server. You need to allow connections to port 8888 for the Content Browser to work. Also, if the web service fails to start, make sure that no other service is using port 8888. The Hosted Mode Browser of Google Web Toolkit is a special web browser that runs the client-side GWT Java code as Java runtime instead of JavaScript. This allows you to debug the client-side components in an IDE such as Eclipse. Hosted Mode Browser in LinuxThe Hosted Mode Browser in Google Web Toolkit 1.5.62/Linux is not compatible with Vaadin. If you want to debug client-side code in Linux you should download the experimental OOPHM-version of Vaadin. This contains a newer GWT which supports using a normal browser for debugging. This is explained more in Section 10.8.7, “Out of Process Hosted Mode (OOPHM)”. Note that you should not use the OOPHM version of Vaadin in production environments, only for debugging.To run the demo applications in the Hosted Mode Browser of Google Web Toolkit, follow the following steps:
Starting demo applications under the Hosted Mode Browser can take considerable time! This is especially true for the Reservation and Color Picker applications, which require compilation of custom widget sets. During this time, the Hosted Mode Browser is unresponsive and does not update its window. Compiling widget sets can take 5-30 seconds, depending on the hardware. As with the Web Mode launcher, after you have run the Hosted Mode launcher once, you can click the dropdown marker on right of the button in the toolbar and select . To use the Hosted Mode Browser in other projects, you need to create a launch configuration in Eclipse. See Section 10.8.6, “Hosted Mode Browser” for more detailed information about the Hosted Mode Browser and how to create the launch configuration. To stop the launched Jetty web container that serves the Content Browser web application, select the Console tab and click on the button. To clean up all terminated launches from the Console window, click on the button. At some point when developing an application, you want to debug it. Running a web application in debug mode is easy in Eclipse. Next, we will show you how to debug the demo applications by inserting a breakpoint in the Calc example.
If you like, you can also use the imported Vaadin demo project as a skeleton for your own project. Just remove any unnecessary files or files related to the demo applications from the project. The proper way of creating a new Vaadin project will be described in the next section: Section 2.4, “Your First Project with Vaadin”. |
Table of Contents
|