1 Reply Latest reply on Jan 7, 2007 11:53 PM by louise_za

    IPC using application variables

    louise_za

      Hi everyone
      I have 2 porlets on a portal page. I would like Portlet A to set an application variable when a link is clicked in the portlet's body. Portlet B must then read this variable and display it. The problem is that Portlet B renders before Portlet A and the variable it displays is consequently always 1 step behind what A set.

      The code in Portlet A to set the variable is in the processAction method and looks as follows:

      String id = aRequest.getParameter("id");
      aResponse.setRenderParameter("id", id);
      PortletSession ps = aRequest.getPortletSession();
      ps.setAttribute("id", id, PortletSession.APPLICATION_SCOPE);
      


      The code in Portlet B (in the jsp page):
      String object_id = (String)request.getSession().getAttribute("id");
      


      Is there something that I am doing wrong or is this just a limitation in the portal architechture?
      (I am using JBoss portal 2.2 bundled)