-
Type:
Bug
-
Status: Open
-
Resolution: Unresolved
-
Affects Version/s: 7.3.1 CE GA2
-
Fix Version/s: None
-
Component/s: Core Infrastructure > MVC Portlet, Pages > Widget Pages
-
Labels:None
-
OS:CentOS 7
-
JDK:Red Hat OpenJDK 8
-
Application Servers:JBoss EAP 7.1
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