[jboss-user] [JBoss jBPM] - Portlet preferences not persisted

PeterJ do-not-reply at jboss.com
Wed Jul 19 15:04:59 EDT 2006

I am trying to update the portlet preferences within my code, but the preferences are not being persisted.  I have based my code on what I found in the WeatherPortlet.  I even added debugging to the WeatherPortlet to see how it was doing things.  Here is the code:

public void processAction(ActionRequest request, ActionResponse response) throws PortletException  {
  |    String newZip = request.getParameter("newzip");
  |    log.debug("newZip=" + newZip);
  |    if(null != newZip) {
  |       PortletPreferences prefs = request.getPreferences();
  |       try {
  |          prefs.setValue("RssXml", RSS_URL_PREFIX + newZip);
  |          prefs.store();
  |          String xxx = prefs.getValue("RssXml", null);
  |          log.debug("RssXml=" + xxx);
  |       } catch(Exception e) {
  |          e.printStackTrace();
  |       }
  |    }
  |    response.setRenderParameter("newzip", RSS_URL_PREFIX + newZip);
  |    response.setPortletMode(PortletMode.VIEW);
  | }

And here is what shows up on the log file (sans leading junk):

  | RssXml=http://xml.weather.yahoo.com/forecastrss?p=33145

The 33145 zip is what is configured in portal.xml.  So immediately after setting the preference and storing it, it disappears and reverts back to the original setting.

Should I open a JIRA issue?

Using:  JBoss 4.0.4-GA, JBoss Portal 2.4.0-CR1, JDK 5.0

Standard disclaimer:  I searched through the forum, JIRA, and even did a general google and could not find anything on this topic.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3959294#3959294

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3959294

More information about the jboss-user mailing list