Can I read the page request parameter from the portlet?

Can a portlet read a request parameter to its neighboring page?

eg. The URL of the page where the portlet is located, http://example.com/mypage?foo=bar Is it possible to read the "foo" parameter from the portlet that is on this page?

Liferay portlet container 5.2.5.

+4
source share
3 answers

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 is the RenderRequest request.

+6
source

PortletRequest class has a getAttribute() method

You can consider it as an HttpServletRequest .

+1
source

I have not yet found a way other than using the platform class com.liferay.portal.util.PortalUtil .

+1
source

All Articles