Gyonder
Gyonder

Reputation: 3756

GWT StockWatcher example explanation

I am beginning with GWT with the StockWatcher example https://developers.google.com/web-toolkit/doc/latest/tutorial/create

I run the application

http://127.0.0.1:8888/StockWatcher.html?gwt.codesvr=127.0.0.1:9997

and it's fine.

I don't understand why when that url is called StockWatcher.gwt.xml is read. I cannot find any link between StockWatcher.html and StockWatcher.gwt.xml in web.xml or elsewhere.

Could anyone tell me what makes StockWatcher.html read the entrypoint in StockWatcher.gwt.xml ?

Thanks

Upvotes: 0

Views: 424

Answers (1)

skywalker
skywalker

Reputation: 415

When you read StockWatcher.gwt.xml there is a tag at the top, saying

 <module rename-to='stockwatcher'>

As you know, GWT converts your java code in to a java script code, which finally runs in your web browser, in this case, all the javascript created by this module is named as stockwatcher.nocache.js which would be inside the folder stockwatcher inside your war directory

Now if you look at the HTML file, it has a line just above closing of like

 <script type="text/javascript" language="javascript" src="stockwatcher/stockwatcher.nocache.js"></script>

so essentially When this page is loaded in the browser, this stockwatcher javascript which is compiled by StockWatcher.gwt.xml module is run

hope it helps.

Upvotes: 1

Related Questions