2 Replies Latest reply on Jul 6, 2006 7:23 AM by louise_za

    Inter-portlet communication using PortletSession

    louise_za

      Hello

      I am trying to get IPC working between 2 portlets. So far I have the following:

      In the processAction methos of portletA I have:

      PortletSession ps = aRequest.getPortletSession();
      ps.setAttribute("id", id, PortletSession.APPLICATION_SCOPE);


      In the doView method of portletB I have:
      PortletSession ps = rRequest.getPortletSession();
      String object = (String)ps.getAttribute("id", PortletSession.APPLICATION_SCOPE);


      I can access the 'id' variable here. I would like to access the id from the jsp that is associated with portletB but have not been able to get that right. I have tried:

      In jspForPortletB:
      String object_id = (String)request.getAttribute("id");


      but I get a null value back. Does anyone have a suggestion as to how I can get the id value in the jsp? I have read in the Portlet Spec that a value stored in the PortletSession should be available in the HttpSesssion.