Reputation: 101
I am new to GWT development, I was just modifing a GWT project which run well before,
Under the eclipse development environment, it run well until one point where the server side need a context param which should be initiated when the servelt was initcontent().
Thus, I had to compile the project , then packed them and deploy them onto a standalone jboss. It don't work under the jboss now.
If it was a common web application , i favor to add "window.alert("")," to web page, and track where the bug occurs and which the context are, but, within gwt, I don't know how do like those, I add gwt`s Window.alert(), it don't work, and I try get help from firebug, but i just find some nameless functions which generated by gwt, I don't know which objects in java are coordinated to those names?
Could some sophisticated guys show me some experience on them?
Actually, in my Gwt code, I need to request a REST request to web service, when I debug GWT in dev module, the client part run well ( namely those code write in GWT),but the server side was wrong -- the dev module did not execute the servlet initcontext() -- it was required to my web server.
thus, I had to deploy my whole project to a standalone jboss, now, I am stuck and I don't know where wrong. maybe another idea was let my client request to a "remote" server ( now its request looks like connecting to local) I fear if this idea was failed, namely my code was good in dev module ,and bugged in product module, how can i add some code like window.alert() with JavaScript to my gwt code to help me debug. Thanks your guys teach me how to debug GWT in eclipse, I more likely want to know how debug it by insert js codes.
Upvotes: 1
Views: 5163
Reputation: 8297
As of GWT 2.8 the primary way to run a GWT App in development environment is by using the "super dev mode" or "code server". this mode compiles the code and runs the JS code in the browser. The old versions before 2.8 had the "dev mode" that used a browser plugin to communicate with the JVM running the webapp in dev mode.
For GWT 2.8 you want to use the dev tools in your browser or a IDE Plugin like https://sdbg.github.io/ (works with chrome only - afaik) which allows you to do most of the debugging in eclipse.
OLD ANSWER
In Eclipse right click on the project and then got to "Debug as" > "Web application".
This way you can debug your GWT App like any other Java Application.
If you need more information on how to use the Java debugging features in Eclipse you may want to look here http://www.vogella.com/articles/EclipseDebugging/article.html
Good luck
Upvotes: 2
Reputation: 64541
You can run your client code in DevMode from your deployed server, using the deployed server-side code (that you could debug remotely too, but that's another story): http://www.gwtproject.org/doc/latest/DevGuideCompilingAndDebugging.html#How_do_I_use_my_own_server_in_development_mode_instead_of_GWT%27s
Upvotes: 0
Reputation: 193
You need to set breakpoints on your code and click Debug dropdown then click GWT Application. (Some cases, your application name will show up on the dropdown also. You can click that.)
Upvotes: 0