DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
  1. DZone
  2. Coding
  3. Java
  4. Debugging Vaadin Client Widgets

Debugging Vaadin Client Widgets

Nicolas Fränkel user avatar by
Nicolas Fränkel
CORE ·
May. 28, 12 · Interview
Like (0)
Save
Tweet
Share
6.77K Views

Join the DZone community and get the full member experience.

Join For Free

When working with standard Vaadin components, you can rely on your prefered IDE's debugger to help you when something unexpected happens. When integrating add-ons with widgets, chances are that something won't work on the client side sooner or later. In this case, IDE debugging won't help and we need something else.

This something else is GWT hosted mode. The first step to enable this feature is to create a launch in Eclipse. In order to that, right-click on your Eclipse project and choose Properties. In the opening pop-up, select the Vaadin menu (type "Vaadin" in upper left field if you need to reduce the number of menu entries).

Click on the Create development mode launch button: this creates a .launch file at the root of the project. Right click on it and choose Debug as 'GWT hosted mode'. This launches the GWT development mode window. Subsequent runs can be directly started from the Debug configurations tool item.

The second step is to use PRETTY style compilation, either through the previous screen or through Maven, depending on your approach.

The third step is optional but recommended. Since there will be a lot of debugging, updating code and compiling to JavaScript cycles, it will speed them up to compile only for the browser you're currently using. Locate your gwt.xml file and insert the following snippet:

<set-property name="user.agent" value="safari" />

 This will set the user agent to Chrome (as well as you guessed, Safari).

The fourth step consists of installing the corresponding plugin in your browser. Launch the application in an embedded server inside Eclipse. Paste the following URL in your browser http://localhost:8080/custom?gwt.codesvr=127.0.0.1:9997.

Note that Internet Explorer download link doesn't work and that Mozilla Firefox version should be comprised between 3.0 and 10.0 for an available plugin to be found.
Either use Google Chrome (or Chromium if you value your privacy). Of course, port and context-root should be customized according to your configuration. Follow the displayed instructions to install the GWT Developer plugin.

From this point on, you get two main assets while debugging:

  • The GWT Development console shows you a bunch of log messages that were previously eaten away. That means you can call GWT.log() in your own code and see the message in the console.
  • You can set breakpoints in Eclipse in client-side code, and expects the execution to stop at these, just like in regular server-side code. With this, you have access to the method calls stack as well as variable values.
There's nothing revolutionary with this technique: GWT developers use it since ages but for Vaadin developers , it's another tool at your disposal to be able to provide top-notch UI components.
Vaadin

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Top 10 Best Practices for Web Application Testing
  • DevOps for Developers: Continuous Integration, GitHub Actions, and Sonar Cloud
  • Secure APIs: Best Practices and Measures
  • How To Build a Spring Boot GraalVM Image

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: