Multiple Entry Points in GWT

2019-02-05 20:56发布

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 module 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!

2条回答
Evening l夕情丶
2楼-- · 2019-02-05 21:41

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

查看更多
该账号已被封号
3楼-- · 2019-02-05 21:56

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.

查看更多
登录 后发表回答