Tuesday, February 17, 2015

[Liferay] Can't access request parameters in v6.2 which worked in v6.1

Hi Friends,

I recently had to migrate a portlet from v6.1 to v6.2 of Liferay. Few regular steps and everything showed up in UI. But whenever I submitted a form, nothing was received at processAction. Like if I submit cityName, it can't be received using request.getParameter("cityName") which was working fine till 6.1

But if I change cityName in form to <portlet:namespace/>cityName then it worked.



But, there is good news so we don't have to change all the forms. We leave the forms as they are and change liferay-portlet.xml.

After <instanceable>true</instanceable> just add the line below.
<requires-namespaced-parameters>false</requires-namespaced-parameters>

The line we just added will let liferay know that portlet namespace will not be there with fields and all the parameters should work as they were.. :)

Hope this helps someone in need.


No comments:

Post a Comment

Note: Only a member of this blog may post a comment.