In liferay portlet preferences I am getting unsupportedoperationexception

StackOverflow https://stackoverflow.com/questions/23237982

  •  07-07-2023
  •  | 
  •  

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();
Était-ce utile?

La solution

Get portletPreferences using code below:

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

   PortletPreferences portletPreferences = PortletPreferencesFactoryUtil.getPortletSetup(
                    actionRequest, portletResource);
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top