Question

I am getting unsupportedoperationexception in liferay 6.2 while using portletpreferences.
I am getting preferences from here

  PortletPreferences prefs = request.getPreferences(); 

Then setting the value in preferences

  prefs.setValue("test", "test"); 
  prefs.store();
Was it helpful?

Solution

Get portletPreferences using code below:

   String portletResource = ParamUtil.getString(
                actionRequest, "portletResource");

   PortletPreferences portletPreferences = PortletPreferencesFactoryUtil.getPortletSetup(
                    actionRequest, portletResource);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top