Ashok
Ashok

Reputation: 1952

How does the GWT client java is converted to a HTML?

I'm developing a GWT web app. I write the code in java in client side. But, when I run the app, it appears as a plain HTML page. What is happening when I compile and run a GWT application. i.e. How does the java class gets converted to HTML? and where does this HTML code reside? I could see a lot of html in /war/. But, none were clear enough for me to understand. Could someone help me understand how GWT compilation works? I have read some online articles:

http://code.google.com/webtoolkit/doc/latest/tutorial/compile.html

This says: the html under /war is important for browser specific. But, I'm interested in finding a html which would contain "textbox" for com.google.client.ui.textbox.

Thank you.

Upvotes: 2

Views: 283

Answers (1)

Strelok
Strelok

Reputation: 51481

GWT doesn't compile your classes to HTML, instead it compiles the to JavaScript, which in turns manipulates the DOM tree of your HTML page. In addition to this, the JavaScript generated by the GWT compiler is heavily obfuscated and minified to reduce the size. That's why you never see the actual package names as they are shortened in the generated JavaScript. If you still want to see meaningful output of the compiler you can add

-style PRETTY

OR

-style DETAILED

to the GWT compiler command line (you can find more detail in the docs you've been reading).

Upvotes: 5

Related Questions