Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-113402

request-params get duplicated when PortletLayoutTypeController is loaded

    Details

    • OS:
      CentOS 7
    • JDK:
      Red Hat OpenJDK 8
    • Application Servers:
      JBoss EAP 7.1

      Description

      After upgrading Liferay to 7.3.1 from 7.2.1, i am facing an issue.

       

      Let's say i am accessing a portlet using the url - _http://localhost:8080/portal/web/guest/search?p_p_id=FooServicesPortlet_WAR_fooapp&p_p_lifecycle=0&p_p_state=maximized&p_p_mode=view&FooServicesPortlet_WAR_fooapp_action=listAll&_FooServicesPortlet_WAR_fooapp_customerId=56

      and on the SpringMVC controller for the action, 

      request.getParameterValues("customerId")
      
      // Expected {"56"}
      // Actual {"56", "56"}

      i am getting a string array with 2 string objects {"56", "56"}.

       

      This behaviour changes with each restart. Sometimes it work correctly and returns only 1 object. Sometimes it returns 2 objects

       

      I have debugged the code and found the issue. Seems the issue is in com.liferay.layout.type.controller.portlet.internal.layout.type.controller.PortletLayoutTypeController.

      At com.liferay.portal.model.impl.LayoutImpl#includeLayoutContent:892 call 

      LayoutTypeController layoutTypeController =
         LayoutTypeControllerTracker.getLayoutTypeController(getType());
      

      and get the implementation of LayoutTypeController.

      (Based on, i guess class-loading order,) the implementation can be either com.liferay.portal.model.impl.LayoutTypeControllerImpl or com.liferay.layout.type.controller.portlet.internal.layout.type.controller.PortletLayoutTypeController

      Whenever it gets LayoutTypeControllerImpl instance everything works as expected and only get single request-param. But if the implementation is PortletLayoutTypeController, The duplicate-request-param issue occurs.

       

      I have debugged further and issue is in the new PortletLayoutTypeController (at line 112) will call DynamicServletRequestUtil.createDynamicServletRequest, which duplicate the request-params (DynamicServletRequestUtil lines 49 - 60)
       
      NB: A workaround for the issue is to black-list the "com.liferay.layout.type.controller" modules

        Attachments

          Activity

            People

            Assignee:
            support-lep@liferay.com SE Support
            Reporter:
            jjohn Jishin John
            Participants of an Issue:
            Recent user:
            Rafael Franchi
            Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Days since last comment:
              1 week, 3 days ago

                Packages

                Version Package