tags:

views:

46

answers:

1

The GWT developer mode embedded http server makes all the sense in the world to me but I confess I do not understand what the "code server" is all about. It strikes me that an html file wraps all the javascript code the browser needs to render the GWT application with the embedded Jetty server handling AJAX during development. So I'm looking for an explanation for including a developer mode code server with GWT. Maybe an explanation of what it is doing will suffice.

+3  A: 

As usual, official docs to the rescue!

When an application is running in development mode, the Java Virtual Machine (JVM) is actually executing the application code as compiled Java bytecode, using GWT plumbing to connect to a browser window. This means that the debugging facilities of your IDE are available to debug both your client-side GWT code and any server-side Java code as well. By remaining in this traditional "code-test-debug" cycle, development mode is by far the most productive way to develop your application quickly.

Igor Klimer
Can you confirm that the code server solely exists to support debugging by the IDE by providing hooks/interactions between the JVM code and the javascript code being rendered by the browser? That makes sense to me but doesn't explain the huge startup delay of even the basic starter GWT app.
pajato0
That precisely explains it - and it's not *huge*, at least compared to the cost of full-blown compilation to JavaScript. When running in development mode, your code is *not* compiled to JavaScript, it's running as compiled Java bytecode - my guess is that the first launch compiles the whole code, the subsequent ones recompile only the relevant parts. Unfortunately, that's the extent of my knowledge on this topic - maybe someone else has something more to add, or you can check the [GWT's Google Group](http://groups.google.com/group/Google-Web-Toolkit).
Igor Klimer