使用liferay和icefaces的Portlet数据共享

发布于 2024-08-17 04:11:15 字数 2961 浏览 1 评论 0原文

我使用的是liferay 1.8.2 和liferay 5.2。我在不同的 war 文件中有许多 portlet,并且我尝试了 liferay 文档中的示例,了解如何在多个 war 中的不同 portlet 之间共享数据,但没有成功。

  1. 通过会话共享,我无法将数据从第一个 portlet 获取到第二个 portlet,即使数据位于 portletsession 应用程序范围内。
  2. 当我使用基于偶数的机制时,当我使用 >和 标签

由以下原因引起:javax.faces.FacesException:无法执行 JSP 生命周期。
在 com.icesoft.faces.webapp.parser.Parser.parse(Parser.java:181)
在 com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:439)
... 189 更多 引起原因:javax.servlet.jsp.JspException:java.lang.reflect.InitationTargetException
在 com.liferay.taglib.portlet.ActionURLTag.doEndTag(ActionURLTag.java:212)
在 com.icesoft.faces.webapp.parser.Parser.executeJspLifecycle(Parser.java:246)
在 com.icesoft.faces.webapp.parser.Parser.executeJspLifecycle(Parser.java:229)
在 com.icesoft.faces.webapp.parser.Parser.executeJspLifecycle(Parser.java:229)
在 com.icesoft.faces.webapp.parser.Parser.executeJspLifecycle(Parser.java:229)
在 com.icesoft.faces.webapp.parser.Parser.executeJspLifecycle(Parser.java:229)
在 com.icesoft.faces.webapp.parser.Parser.executeJspLifecycle(Parser.java:229)
在 com.icesoft.faces.webapp.parser.Parser.executeJspLifecycle(Parser.java:229)
在 com.icesoft.faces.webapp.parser.Parser.executeJspLifecycle(Parser.java:229)
在 com.icesoft.faces.webapp.parser.Parser.parse(Parser.java:162)
... 190 更多
引起原因:java.lang.reflect.InitationTargetException
在 sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法)
在 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
在 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
在 java.lang.reflect.Method.invoke(Method.java:597)
在 com.liferay.portal.kernel.util.MethodInvoker.invoke(MethodInvoker.java:180)
在 com.liferay.portal.kernel.util.MethodInvoker.invoke(MethodInvoker.java:49)
在 com.liferay.taglib.portlet.ActionURLTag.doTag(ActionURLTag.java:179)
在 com.liferay.taglib.portlet.ActionURLTag.doEndTag(ActionURLTag.java:200) ... 199 更多
引起原因:javax.servlet.jsp.JspException:java.lang.UnsupportedOperationException
在 com.liferay.portal.servlet.taglib.portlet.ActionURLTagUtil.doEndTag(ActionURLTagUtil.java:174)
... 207 更多
引起原因:java.lang.UnsupportedOperationException
在 com.icesoft.faces.webapp.parser.StubHttpServletRequest.getAttribute(StubHttpServletRequest.java:116)
在 com.liferay.portal.servlet.taglib.portlet.TagUtil.getPortletName(TagUtil.java:100)
在 com.liferay.portal.servlet.taglib.portlet.ActionURLTagUtil.doEndTag(ActionURLTagUtil.java:68)

任何人都可以建议详细的解释和示例代码,我如何在驻留在不同 WAR 的 portlet 之间实现 IPC

I am using liferay 1.8.2 and liferay 5.2. I have many portlets in different war files and I tried the examples in the liferay docs as to how to share data between differenet portlets across multiple wars with no success.

  1. With sesssion sharing , I was not able to get the data from the first portlet to the second portlet, even thou the data was in the portletsession application scope.
  2. When I use the even based mechanism, I get an error when I use the
    <portlet:defineObjects /> and <portlet:actionURL /> tags

Caused by: javax.faces.FacesException: Failed to execute JSP lifecycle.
at com.icesoft.faces.webapp.parser.Parser.parse(Parser.java:181)
at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:439)
... 189 more
Caused by: javax.servlet.jsp.JspException: java.lang.reflect.InvocationTargetException
at com.liferay.taglib.portlet.ActionURLTag.doEndTag(ActionURLTag.java:212)
at com.icesoft.faces.webapp.parser.Parser.executeJspLifecycle(Parser.java:246)
at com.icesoft.faces.webapp.parser.Parser.executeJspLifecycle(Parser.java:229)
at com.icesoft.faces.webapp.parser.Parser.executeJspLifecycle(Parser.java:229)
at com.icesoft.faces.webapp.parser.Parser.executeJspLifecycle(Parser.java:229)
at com.icesoft.faces.webapp.parser.Parser.executeJspLifecycle(Parser.java:229)
at com.icesoft.faces.webapp.parser.Parser.executeJspLifecycle(Parser.java:229)
at com.icesoft.faces.webapp.parser.Parser.executeJspLifecycle(Parser.java:229)
at com.icesoft.faces.webapp.parser.Parser.executeJspLifecycle(Parser.java:229)
at com.icesoft.faces.webapp.parser.Parser.parse(Parser.java:162)
... 190 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.liferay.portal.kernel.util.MethodInvoker.invoke(MethodInvoker.java:180)
at com.liferay.portal.kernel.util.MethodInvoker.invoke(MethodInvoker.java:49)
at com.liferay.taglib.portlet.ActionURLTag.doTag(ActionURLTag.java:179)
at com.liferay.taglib.portlet.ActionURLTag.doEndTag(ActionURLTag.java:200)
... 199 more
Caused by: javax.servlet.jsp.JspException: java.lang.UnsupportedOperationException
at com.liferay.portal.servlet.taglib.portlet.ActionURLTagUtil.doEndTag(ActionURLTagUtil.java:174)
... 207 more
Caused by: java.lang.UnsupportedOperationException
at com.icesoft.faces.webapp.parser.StubHttpServletRequest.getAttribute(StubHttpServletRequest.java:116)
at com.liferay.portal.servlet.taglib.portlet.TagUtil.getPortletName(TagUtil.java:100)
at com.liferay.portal.servlet.taglib.portlet.ActionURLTagUtil.doEndTag(ActionURLTagUtil.java:68)

Can anybody suggest with detailed explaination and sample code, how I can achieve IPC between portlets residing across different WAR

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

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

发布评论

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

评论(1

一腔孤↑勇 2024-08-24 04:11:15

使用 IceFaces 1.8.x 无法在不同的 WAR 之间进行 Portlet 间通信 (IPC)。

当 IceFaces 2.0 发布时,这是可能的,Alpha 版本已经可用。

但是,可以使用 IceFaces 1.8.x 执行某种 IPC。 Icefaces 开发者指南的“高级主题”一章涵盖了以下主题:

使用 Ajax Push 允许 portlet
基于服务器端进行更新
改变状态的事件
当前视图。这可以是一个强大的
还可以利用该功能
做一种形式的interportlet
通信(IPC)在某些
配置。

IPC 仅在 Portlet 中提及
1.0 规范 (JSR 168),但在 Portlet 2.0 中正式定义
规范(JSR 286)。

它被设计为事件/监听器
模型。但是,可以使用
ICEfaces Ajax Push 机制
根据更改更新 portlet
底层模型。该怎么做
目前 ICEfaces 的目标是:

  • 将需要通信的 portlet 部署在同一存档 (.war
    文件)。
  • 使用应用程序范围的 Bean 来管理组件之间的共享状态
    portlet。
  • 使用 ICEfaces Ajax Push 功能触发客户端更新
    当共享状态发生变化时。
  • 有关如何执行此操作的示例,请查看示例 ICEfaces 聊天
    portlet。

Inter Portlet Commuication (IPC) is not possible across different WARs using IceFaces 1.8.x.

It will be possible when IceFaces 2.0 is out, an Alpha is already available.

However, it is possible to do some sort of IPC using IceFaces 1.8.x. The "Advanced Topics" chapter of the Icefaces Develpers Guide covers this topic:

The use of Ajax Push allows portlets
to be updated based on server-side
events that change the state of the
current view. This can be a powerful
feature that can also be leveraged to
do a form of interportlet
communication (IPC) in certain
configurations.

IPC is only mentioned in the Portlet
1.0 spec (JSR 168) but is formally defined in the Portlet 2.0
specification (JSR 286).

It is architected as an Event/Listener
model. However, it is possible to use
the ICEfaces Ajax Push mechanism to
update portlets based on changes to
the underlying model. The way to do
this currently with ICEfaces is to:

  • Deploy the portlets that need to communicate in the same archive (.war
    file).
  • Use application-scoped beans to manage shared state between the
    portlets.
  • Use the ICEfaces Ajax Push feature to trigger client updates
    when the shared state changes.
  • For an example of how to do this, review the sample ICEfaces Chat
    portlet.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文