In liferay portlet preferences I am getting unsupportedoperationexception

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

  •  07-07-2023
  •  | 
  •  

Pergunta

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();
Foi útil?

Solução

Get portletPreferences using code below:

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

   PortletPreferences portletPreferences = PortletPreferencesFactoryUtil.getPortletSetup(
                    actionRequest, portletResource);
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top