It it possible to read a page request parameter from portlet?

java, liferay, portlet

Solution

Yes this can be achieved with something like this -

HttpServletRequest convertReq = PortalUtil.getHttpServletRequest(request);
HttpServletRequest originalReq = PortalUtil.getOriginalServletRequest(convertReq);
String productId = originalReq.getParameter("foo");

Where request is RenderRequest.

Problem

It is posible for a portlet to read a request parameter of its surrounding page? E.g. the URL of the page the portlet resides in is http://example.com/mypage?foo=bar Is it possible to read the "foo" parameter from a portlet that is on that page? Portlet Container is Liferay 5.2.5.

Original source