2013-05-06 65 views
0

我开始使用GWT用的StockWatcher例如https://developers.google.com/web-toolkit/doc/latest/tutorial/createGWT的StockWatcher例子解释

我运行应用程序

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

和它的罚款。

我不明白为什么当这个URL被称为 StockWatcher.gwt.xml被读取。我在web.xml 或其他地方找不到StockWatcher.html和StockWatcher.gwt.xml之间的任何链接。

任何人都可以告诉我什么使StockWatcher.html读取StockWatcher.gwt.xml中的入口点?

感谢

回答

1

当你阅读StockWatcher.gwt.xml有在顶部的标签,说

<module rename-to='stockwatcher'> 

如你所知,GWT转换Java代码中的Java脚本代码,终于在你的网络浏览器中运行,在这种情况下,这个模块创建的所有javascript被命名为stockwatcher.nocache.js,它将位于战争目录内的文件夹stockwatcher

现在,如果你看HTML文件,它在李的闭幕之上有一条线柯

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

所以基本上当这个页面在浏览器加载,这是由StockWatcher.gwt.xml模块编译此的StockWatcher的JavaScript运行

希望它帮助。

+0

谢谢。很明显 – Gyonder 2013-05-07 06:51:19