Search code examples
event-handlingportletjsr286

Is eventing the only way of inter portlet communication


I got the impression from reading articles on jsr286 eventing that the eventing feature enables portlets to communicate with one another if they belong to different .war files.

I just want to confirm that even if 2 portlets belong to same war file, the only way they can communicate is through eventing.

Since the whole request forwarding feature of servlets do not apply to portlets. Is this correct?


Solution

  • Portlets events can be used between portlets in the same wars or in different wars. However, one of the limitations of the portlets events is that the 2 portlets must be on the same page.

    There are others ways to communicate between 2 portlets. You can use Public Render Parameters. The idea is that the first portlet sets a parameter, and the second portlet can read it in order to retrieve the value. You can also use the Application scope of the PortletSession to communicate and share data. The application scope (APPLICATION_SCOPE) of a PortletSession is shared between all the portlets of the same war.