English 中文(简体)
Portlet Data sharing using liferay and icefaces
原标题:

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

问题回答

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.




相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签