portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject svn commit: r499871 - /portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/pipeline/valve/impl/ActionValveImpl.java
Date Thu, 25 Jan 2007 17:56:46 GMT
Author: taylor
Date: Thu Jan 25 09:56:41 2007
New Revision: 499871

URL: http://svn.apache.org/viewvc?view=rev&rev=499871
Log:
When servlet containers are clustered, ActionValveImpl can throw NullPointerException
https://issues.apache.org/jira/browse/JS2-646

patch from Woonsan Ko

Modified:
    portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/pipeline/valve/impl/ActionValveImpl.java

Modified: portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/pipeline/valve/impl/ActionValveImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/pipeline/valve/impl/ActionValveImpl.java?view=diff&rev=499871&r1=499870&r2=499871
==============================================================================
--- portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/pipeline/valve/impl/ActionValveImpl.java
(original)
+++ portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/pipeline/valve/impl/ActionValveImpl.java
Thu Jan 25 09:56:41 2007
@@ -16,6 +16,7 @@
 package org.apache.jetspeed.pipeline.valve.impl;
 
 import java.io.IOException;
+import java.util.HashMap;
 
 import javax.portlet.PortletException;
 import javax.servlet.http.HttpServletRequest;
@@ -25,8 +26,9 @@
 import org.apache.commons.logging.LogFactory;
 import org.apache.jetspeed.PortalReservedParameters;
 import org.apache.jetspeed.container.window.PortletWindowAccessor;
-import org.apache.jetspeed.messaging.PortletMessagingImpl;
 import org.apache.jetspeed.om.common.portlet.MutablePortletEntity;
+import org.apache.jetspeed.om.page.ContentFragment;
+import org.apache.jetspeed.om.page.ContentFragmentImpl;
 import org.apache.jetspeed.om.page.Fragment;
 import org.apache.jetspeed.om.page.Page;
 import org.apache.jetspeed.pipeline.PipelineException;
@@ -84,6 +86,22 @@
             PortletWindow actionWindow = request.getActionWindow();
             if (actionWindow != null)
             {
+                // If portlet entity is null, try to refresh the actionWindow.
+                // Under some clustered environments, a cached portlet window could have
null entity.
+                if (null == actionWindow.getPortletEntity())
+                {
+                    try 
+                    {
+                        Fragment fragment = request.getPage().getFragmentById(actionWindow.getId().toString());
+                        ContentFragment contentFragment = new ContentFragmentImpl(fragment,
new HashMap());
+                        actionWindow = this.windowAccessor.getPortletWindow(contentFragment);
+                    } 
+                    catch (Exception e)
+                    {
+                        log.error("Failed to refresh action window.", e);
+                    }
+                }
+
                 initWindow(actionWindow, request);
                 HttpServletResponse response = request.getResponseForWindow(actionWindow);
                 HttpServletRequest requestForWindow = request.getRequestForWindow(actionWindow);



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message