[jboss-jira] [JBoss JIRA] Created: (JBPORTAL-2232) Changes made to PortletPreferences do not persist during a JSR 286 serveResource method call

Philip Kedy (JIRA) jira-events at lists.jboss.org
Fri Nov 7 23:02:36 EST 2008


Changes made to PortletPreferences do not persist during a JSR 286 serveResource method call
--------------------------------------------------------------------------------------------

                 Key: JBPORTAL-2232
                 URL: https://jira.jboss.org/jira/browse/JBPORTAL-2232
             Project: JBoss Portal
          Issue Type: Bug
      Security Level: Public (Everyone can see)
          Components: Portal Portlet
    Affects Versions: 2.7.0 Final
         Environment: N/A
            Reporter: Philip Kedy


When executing the code below from a serveResource method the value is not persisted.  No exceptions show up in the log.

		PortletPreferences preferences = request.getPreferences();
		preferences.setValue("test", "set from resource");
		preferences.store(); // Does not work

Of course the same code works as expected from an action request.

		PortletPreferences preferences = request.getPreferences();
		preferences.setValue("test", "set from action");
		preferences.store(); // Works

I believe I have tracked down the issue by stepping through the JBP 2.7 and Portlet Container 2.0 source code.

Problem:
      In org.jboss.portal.portlet.state.producer.ProducerPortletInvoker - around line 232:
      The invocation object is missing an instanceof test for ResourceInvocation.

Current code:
      if (invocation instanceof ActionInvocation && status == AbstractPropertyContext.UPDATE_SUCCESSFUL)

Proposed code:
      if ((invocation instanceof ActionInvocation || invocation instanceof ResourceInvocation) && status == AbstractPropertyContext.UPDATE_SUCCESSFUL) 

I tested this by patching portal-portlet-lib.jar with the revision above and it seems to work.

Hope this helps.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list