2 Replies Latest reply on Oct 26, 2005 10:02 AM by Bradley Smith

    how communicate between portlets?

    pedro costa Apprentice

      If i've 2 portlets and i want to send information between them, what should i do? I can't find any example to clarify me.

      By the way, where can i find good examples of portlets with java source in it (not only class files) beside portletswap.com?


        • 1. Re: how communicate between portlets?
          Woodler Expert

          in 2.0 user an action request to set the state into the HttpSession , and have the second portlet pick it up there

          in 2.2 there is a new feature called IPC (inter portlet communication) that allows for just that. there is an example in the core portal when you build it from cvs (until there is a binary download: remember: 2.2 is pre alpha, but it works great already)

          • 2. Re: how communicate between portlets?
            Bradley Smith Master


            I would use the PortletSession approach - it will result in portlets that are more portable (and probably, simpler, easier to maintain, less prone to changes in the underlying inter-portlet-communication API's - which are going to be brand new, etc.).

            Another design aspect for you to consider is this - Having portlet 1 depend on portlet 2 via inter-portlet communication API's can easily result in portlet implementations that break if one or more of the 'communicating' portlets is not available (or throws an exception).