GWT 中的多个入口点

发布于 2024-09-10 19:27:01 字数 621 浏览 1 评论 0原文

我正在使用 Google Web Toolkit,并且对 GWT 中的入口点有点困惑。谷歌的文档说:

如果模块内有多个 EntryPoint(定义 onModuleLoad() 的接口),则一旦该模块(和外部文档)准备就绪,它们都会按顺序调用。 如果您要在同一页面中加载多个 GWT 模块,则一旦该模块和外部文档准备就绪,就会调用每个模块的 EntryPoint。不保证两个模块的 EntryPoints 同时触发,或者按照在主机页中指定其选择脚本的相同顺序触发。

那么您网站中的每个页面都需要为其定义一个入口点吗?

当您基于 Java 类生成 javascript 时,您是否真的需要一个入口点?

您是否能够将多个自动生成的 js 定义组合到一个 *.gwt.xml 文件中?

编辑:链接到引用的来源:http://code.google.com/webtoolkit/ doc/1.6/DevGuideOrganizingProjects.html

谢谢!

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!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

ヅ她的身影、若隐若现 2024-09-17 19:27:02

制作 GWT 应用程序最直接的方法是为整个应用程序使用一个页面,以及一个顶级 模块(在 .gwt.xml 文件)。每个模块都有一个 EntryPoint 类。然后,所有不同的“页面”都是同一页面的子部分,理想情况下使用 GWT 的历史记录机制来跟踪状态更改,这些状态更改在非 AJAX Web 应用程序中将是新页面。因此,如果您以这种方式进行设置,您的整个应用程序将需要一个入口点。

您引用的文档(链接?)讨论了我认为的高级用例,其中您在单个页面上加载了多个模块。

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.

万水千山粽是情ミ 2024-09-17 19:27:02

有一个选项,你可以创建带有子项目的maven项目,意味着你可以创建多个入口点,
每个入口点都有自己的 html。 查看更多详细信息

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文