0

we all agree that when we use GWT, we compile our application on the server, several javascript file are created. Normally, when deploying, we would use the obfuscated mode.

Now modifying a javascript file in obfuscated mode is almost impossible. Now what happens if we want to make some modification in our GWT application.

Do we have to go back again in Java, modify the file, compile, and then deploy again??

3 Answers 3

3

I'd say yes... If you use a code generator you should avoid modifying the generated code by hand.

2

No, no, no.

You don't "go back" to the Java code to modify it. You simply debug, test and modify the Java code. You ignore the code in the compiled javascript files except to deploy it. As far as you are concerned, GWT source code is Java code, not javascript, written within the environmental restriction of the browser.

Your question is like asking, "I have a C application that gets compiled to object code. Do I modify the object code or go back to the C code to modify it?" !!!

You simply treat the generated javascript as "native code".

No doubt you can include javascript using jsni, and so can you include assembly code when using C. So except for those assembly code you inject and similarly except the javascript code you include, you leave the "native code" alone.

When you try to modify the object code generated from C, that is called hacking. Hacking is an interesting hobby but when you wish to create an application and your main task is not "hacking", hacking would only be your extra-curricular activity not connected to your main employment or project.

0

Go back to the beginning: http://code.google.com/webtoolkit/overview.html

...Write AJAX applications in Java and then compile the source to highly optimized JavaScript that runs across all browsers

When you're ready to deploy, GWT compiles your Java source code into optimized, stand-alone JavaScript files that automatically run on all major browsers, as well as mobile browsers for Android and the iPhone.

While debugging: if you are running in development mode you may not even have to redeploy while in dev.

Thanks to the GWT developer plugin, there's no compiling of code to JavaScript to view it in the browser. You can use the same edit-refresh-view cycle you're used to with JavaScript...

Not the answer you're looking for? Browse other questions tagged or ask your own question.