3 Replies Latest reply on Jul 25, 2011 7:24 AM by donino doninos

    Portlet preferences within serveResource method

    donino doninos Newbie



      I'm trying to set the portlet preferences through an AJAX call. I've opted to use the serveResource() method of the portlet. When I invoke the portlet function, serveResource(), through the AJAX call, the method does get executed. Within the serveResource() method, I then proceed to update my portlet preference:


      String mypreference= request.getParameter("mypreference");

      PortletPreferences portletPreference = request.getPreferences();
      portletPreference.setValue("mypreference", mypreference);


      It doesnt throw an exception, but it doesnt work neither: mypreference is correctly updated in resourceRequest, but not stored permanently. Specifications 286 seems authorize update preferences in serveResource method (PLT.13.1):


      For serveResource calls only state changes to non-shared state, like the portlet session scope or portlet preferences, should be performed


      , and it works in liferay. 


      Do someone has informations about this issue?