1 Reply Latest reply on Feb 23, 2010 6:15 AM by bharath sadanagiri

    How to clear portlet cache?

    bharath sadanagiri Newbie

      Hi,

       

      In my jboss portal I have different Tabs like Home,Reports and apps.

      Step 1:I clicked on Home tab first, all the portlets in Home tab got loaded and did some operations in all the portlets. So resultant portlets displayed in the Home page.

      Step 2:After that I moved to reports tab and did some operations on all the report portlets. So resultant portlets displayed in the Reports page.

      Step 3:I navigated between all the tabs but the last resultant portlets are still getting displayed.


      So my question is: Is there any configuaration like Expiration-Cache tag to display the default pages when the tab is clicked?

      Am using portal version 2.6.5 and tried

           <expiration-cache>0</expiration-cache> 

      which is not helped

       

      Thanks,

      Bharath

        • 1. Re: How to clear portlet cache?
          bharath sadanagiri Newbie

          Hi,
          I got the answer from the following site.

          Once ActionResponse.setRenderParameter () is called, parameter will be available between all sub sequent requests.
          http://portals.apache.org/pluto/portlet-1.0-apidocs/javax/portlet/ActionResponse.html

          This link https://www.ibm.com/developerworks/mydeveloperworks/blogs/Joey_Bernal/entry/refreshing_a_portlet_on_the?lang=en
          provides a solution. It says instead of setting parameters in renderRequest object in processAction (), set it in session, once used in JSP, remove from session. In this way, you can solve this problem. Move all parameters to session and remove it as soon as you have used in page.

          In my case, I moved the navagation key like actionCommand to session and removed in the doView method itself. Please find the piece of code.
          in doView() method
          ============
          PortletSession ps = req.getPortletSession();
          String actionCommand= (String)ps.getAttribute("actionCommand");
          if( ( actionCommand!=null && actionCommand.length()>0 )&& actionCommand.equals("displayCompanyUserReport")){ 
          LOG.debug("Forwarding the request to DisplayCompanyUserReport.jsp for the default functionality");
          prd = getPortletContext().getRequestDispatcher("/view/DisplayCompanyUserReport.jsp");
          ps.removeAttribute("actionCommand");
          LOG.debug("Removed actionCommand from the session");
          }
          in processAction() method
          =================
          String actionCommand= req.getParameter("actionCommand");
          if( ( actionCommand!=null && actionCommand.length()>0 )&& actionCommand.equals("displayCompanyUserReport")){ 
          res.setRenderParameter("companyId", req.getParameter("companyId"));
          res.setRenderParameter("actionCommand", "dummy");
          session.setAttribute("actionCommand", "displayCompanyUserReport");
          }

          Regards,
          bharath