portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From woon...@apache.org
Subject svn commit: r772723 - /portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/url/impl/DesktopEncodingPortalURL.java
Date Thu, 07 May 2009 17:39:43 GMT
Author: woonsan
Date: Thu May  7 17:39:43 2009
New Revision: 772723

URL: http://svn.apache.org/viewvc?rev=772723&view=rev
Log:
Fixing NPE when performing action under desktop mode.

Modified:
    portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/url/impl/DesktopEncodingPortalURL.java

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/url/impl/DesktopEncodingPortalURL.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/url/impl/DesktopEncodingPortalURL.java?rev=772723&r1=772722&r2=772723&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/url/impl/DesktopEncodingPortalURL.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/url/impl/DesktopEncodingPortalURL.java
Thu May  7 17:39:43 2009
@@ -25,10 +25,11 @@
 import javax.servlet.http.HttpServletRequest;
 
 import org.apache.jetspeed.PortalContext;
+import org.apache.jetspeed.container.PortletWindow;
 import org.apache.jetspeed.container.state.NavigationalState;
 import org.apache.jetspeed.container.url.BasePortalURL;
+import org.apache.jetspeed.container.url.PortalURL;
 import org.apache.jetspeed.desktop.JetspeedDesktop;
-import org.apache.jetspeed.container.PortletWindow;
 
 /**
  * DesktopEncodingPortalURL encodes action URLs to target desktop specific /action pipeline,
@@ -148,7 +149,16 @@
 
     protected String createPortletURL(String encodedNavState, boolean secure)
     {
-        return createPortletURL(encodedNavState, secure, null, URLType.RENDER, false);
+        // org.apache.pluto.container.impl.PortletContainerImpl invokes responseContext.getResponseURL(),
+        // which invokes this method without window object.
+        // So, in case of action, we need to find actionWindow to avoid NPE.
+        PortletWindow actionWindow = null;
+        if (PortalURL.URLType.ACTION == navState.getURLType())
+        {
+            actionWindow = navState.getPortletWindowOfAction();
+        }
+        
+        return createPortletURL(encodedNavState, secure, actionWindow, URLType.RENDER, false);
     }
     
     protected String createPortletURL(String encodedNavState, boolean secure, PortletWindow
window, URLType urlType, boolean desktopRequestNotAjax)



---------------------------------------------------------------------
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