26 April, 2012

Read parameter value from URL

In Liferay portlet you can not directly read parameter from URL using http request.
So for that you can use below code to read the parameter value.

You can read URL parameter value for below different situation in liferay :




In JSP:
String paramValue = PortalUtil.getOriginalServletRequest(request).getParameter("paramName");

In   render() :

HttpServletRequest request = PortalUtil.getHttpServletRequest(renderRequest);
String paramValue = PortalUtil.getOriginalServletRequest(request).getParameter("paramName");

In   processAction() :

HttpServletRequest request = PortalUtil.getHttpServletRequest(actionRequest);
String paramValue = PortalUtil.getOriginalServletRequest(request).getParameter("paramName");

Popular Posts

Featured Post

Liferay 7.3 compatibility matrix

Compatibility Matrix Liferay's general policy is to test Liferay Portal CE against newer major releases of operating systems, open s...