开发者

Multiple Entry Points in GWT

开发者 https://www.devze.com 2023-01-07 22:16 出处:网络
I\'m getting into Google Web Toolkit, and am a little confused about the Entry Points in GWT.Google\'s docs say:

I'm getting into Google Web Toolkit, and am a little confused about the Entry Points in GWT. Google's docs say:

If you have multiple EntryPoints (the interface that defines onModuleLoad()) within a module, they will all be called in sequence as soon as that module (and the outer document) is ready. If you are loading multiple GWT modules within the same page, each module's EntryPoint will be called as soon as both that mod开发者_开发问答ule and the outer document is ready. Two modules' EntryPoints are not guaranteed to fire at the same time, or in the same order in which their selection scripts were specified in the host page.

So does each page in your website need an Entry Point defined for it?

Do you only really NEED an entry point when you have javascript generated based on your Java classes?

Are you able to combine multiple auto-generated-js definitions into a single *.gwt.xml file?

EDIT: Link to quoted source: http://code.google.com/webtoolkit/doc/1.6/DevGuideOrganizingProjects.html

Thanks!


The most straightforward way to make a GWT app is to have a single page for the entire application, and a single top-level module (defined in a .gwt.xml file). Each module has a single EntryPoint class. Then all of your different "pages" are sub-sections of the same page, ideally using GWT's history mechanism to keep track of state changes that in a non-AJAX web app would be new pages. So if you set things up this way you'll need one EntryPoint for your whole app.

The bit of the docs that you quoted (link?) discuss what I think is an advanced use case, where you've got more than one module that you're loading on a single page.


there is one options, U can create maven project with sub projects, means U can create multi entrypoint,
each entry point have own html. See more details

0

精彩评论

暂无评论...
验证码 换一张
取 消