是否可以在单独的 war 文件中创建动态可插入的 GWT 小部件/portlet?

发布于 2024-07-17 21:46:53 字数 379 浏览 4 评论 0原文

是否可以在 GWT 中创建可以动态加载并添加到 GWT Web 应用程序的小部件/portlet,并且 GWT 小部件可以驻留在单独的 war 文件中?

为了澄清我的问题: 符合 JSR168/JSR286 的门户允许在单独的项目(war 文件)中创建 portlet 并将其动态加载到门户页面中。 假设您想在 GWT 应用程序中执行类似的操作。 因此,假设我们仅使用 GWT 作为 GUI(没有 JSP 或类似内容)创建了一个门户,并且我们想要动态添加一个用纯 GWT 编写的“portlet”。 这可能吗?

我可以想象它可以使用 IFrame 来完成,但如果这样的 GWT 小部件/portlet 完全成为 GWT 主机“门户”应用程序的一部分并共享其样式表和其他资源,那就更好了。

Is it possible to create widgets / portlets in GWT that can be dynamically loaded and added to a GWT web application, and where the GWT widgets can reside in a separate war files?

To clarify my question:
JSR168/JSR286 compliant portals make it possible to create portlets in separate projects (war files) and to dynamically load these into a portal page. Suppose you want to do something similar in a GWT application. So suppose we made a portal using only GWT for the GUI (no JSP or alike) and we want to dynamically add a "portlet" written in pure GWT. Would that be possible?

I can imagine that it could be done using an IFrame, but it would be nicer if such a GWT widget/portlet would be fully part of the GWT host "portal" application and share it's style sheets and other resources.

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

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

发布评论

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

评论(3

ペ泪落弦音 2024-07-24 21:46:53

我认为“GWT portlet”只不过是您自己编写的一个小部件(并且可能实现了一个通用接口)。

困难的部分是动态地允许预编译的 gwt 应用程序包含另一个 gwt 组件(在本例中为 portlet),而无需再次使用源代码进行编译(这就是问题似乎暗示的内容)。

I'd imagine that a "GWT portlet" is nothing more than a widget that you write yourself (and perhaps implements a common interface).

The hard part is to dynamically allow a precompiled gwt app to include another gwt component (the portlet in this case) without compiling again with the source (which is what the question seems to imply).

半夏半凉 2024-07-24 21:46:53

我也一直在研究这个问题,尤其是在看过 Wave 演示之后。 据我所知,wave 团队采取的方法是使用 Google Gadget api 或 Gadget api 的变体。 Google 还提供了有关使用 GWT 编写小工具的教程。 我想您会使用基于事件的 api,其中 JSO 对象在 Gadget 和 GWT 应用程序之间传递。 请注意,如果来自不同的域,这也可能会引入 XSS 问题。 我认为这类似于在 Flash 中动态加载 swf。 该事件方法类似于安全地处理跨站点动态加载的 swf。

I too have been looking into this, especially after seeing the Wave demo. From what I can tell, the approach the wave team have taken is to use either the Google Gadget api or a variation of the Gadget api. Google also have a tutorial on writing a gadget in GWT. I would image you would use a event based api where JSO objects are passed between the Gadget and the GWT application. Note that this may also introduce XSS issues if from different domains. I think of this as akin toloading a swf dynamically in flash. The event method is similar to working safely with cross-site dynamic loaded swf's.

残花月 2024-07-24 21:46:53

我对 GWT 还很陌生,但根据我读过的内容,我可以告诉您,您必须遵循带有应用程序控制器的架构 MVP,该控制器可以动态地“插入”和“播放”您想要使用必须使用元数据分派的内容。来自模型层......类似于“元应用程序”

I'm very new in GWT yet, but based in what i'd readed I can tell you that you must follow an architecture MVP with an App Controller that "plug" and "play" dynamically what you want to dispatch using metadata that must come from the model layer... Something like a "meta-application"

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