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");

Rate Me:

0 Discussion:

Post a Comment

Your Comments on this post

Re:(4) Do you want a million for the New Year?

To unsubscribe, send us an email with the subject 'unsubscribe' qiWv qiWv Do you want a million for the New Year? qiWv qiWv ...