4 Replies Latest reply on Oct 18, 2006 2:01 PM by Woodler

    Persisting Prefs broken in 2.4 ?

    Paul Freeman Newbie

      Hi, I've been trying to store changes to portlet preferences with no joy.

      I have this fragment in portlet.xml

      <portlet-preferences>
       <preference>
       <name>listSize</name>
       <value>10</value>
       <read-only>false</read-only>
       </preference>
      </portlet-preferences>


      However I get a ReadOnlyException when I try to store a change to this.

      try {
      String listSize = aRequest.getParameter("listSize");
       if (listSize!=null) {
       aRequest.getPreferences().setValue("listSize", listSize);
       }
      }
      catch (ReadOnlyException r){
       //TODO log this
       r.printStackTrace();
       }
      


      I have my app deployed as an EAR file. I'm curious as to how a portlet preference is stored (assuming its working rather than what I am getting).