Martín Verzilli

Martín Verzilli

Debugging a deployed GWT application from Eclipse

2 min
May 13 2008
coding
2 min
May 13 2008

I know I promised a mini DEVS model for this post. But I bumped into this interesting thing and I wanted to share it.

We are currently working on a JSF web application which has a GWT component in it. To debug the app, we have to compile the GWT component and put it inside the static content folder. This is just ok to debug the JSF part of the story, but what about the GWT component?

Well, if you deploy your app with the already compiled GWT component (i.e.: just a bunch of javascript and html files) and run it, then you can also run the GWT's hosted browser in debug mode and enter the URL of your just-deployed JSF web app.

Voila! Now you're able to debug your GWT component as usual, putting breaks wherever you want to, inspecting values and expressions, etc. This was really surprising to me, the hosted browser knows how to go back from already compiled javascript code to our original Java source. But then I realized it's exactly what happens when you click "Compile and Browse" in hosted mode, so it was totally reasonable.

Martin