How HTML files are associated with JAVA files?

12 views
Skip to first unread message

Dims

unread,
Oct 24, 2011, 9:23:08 AM10/24/11
to Google Web Toolkit
The sample apllication (Hello GWT) has html, css and java files of the
same name. But what if I have several HTMLs and several Java classes?
How GWT knows which html relates to which java?

As I understood, java turns to javascript in GWT. So, the process
starts from html loading in browser. So, where it is said in this
html, what java class to use?

Or I can have only one html in my application and only one EntryPoint
class?

Thanks

Thomas Broyer

unread,
Oct 24, 2011, 9:34:12 AM10/24/11
to google-we...@googlegroups.com
You missed the key organizational part of GWT: modules (in the form of gwt.xml files). The module is what you give to the GWT compiler, and what's used to determine the name of the JS "entry point" file being generated (the *.nocache.js file). The HTML page simply loads that script; and a GWT module defines an entry-point class that's called when the module is loaded.

If you want distinct HTML pages using distinct EntryPoint classes, then use distinct GWT modules.
Reply all
Reply to author
Forward
0 new messages