Author: chris.laprun(a)jboss.com
Date: 2010-02-22 08:05:53 -0500 (Mon, 22 Feb 2010)
New Revision: 1799
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletActionListener.java
Log:
- Do not attempt to setup PRPs if there are no request parameters (otherwise, this'll
lead to an NPE).
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletActionListener.java
===================================================================
---
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletActionListener.java 2010-02-22
11:42:26 UTC (rev 1798)
+++
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletActionListener.java 2010-02-22
13:05:53 UTC (rev 1799)
@@ -36,6 +36,7 @@
import org.exoplatform.webui.event.Event.Phase;
import org.exoplatform.webui.event.EventListener;
import org.gatein.common.util.MultiValuedPropertyMap;
+import org.gatein.common.util.ParameterValidation;
import org.gatein.pc.api.Mode;
import org.gatein.pc.api.ParametersStateString;
import org.gatein.pc.api.PortletContext;
@@ -617,9 +618,7 @@
setupPublicRenderParams(uiPortlet, request.getParameterMap());
//set render params
- String navState =
- ((PortalRequestContext)event.getRequestContext())
-
.getRequestParameter(ExoPortletInvocationContext.NAVIGATIONAL_STATE_PARAM_NAME);
+ String navState =
event.getRequestContext().getRequestParameter(ExoPortletInvocationContext.NAVIGATIONAL_STATE_PARAM_NAME);
uiPortlet.setNavigationalState(ParametersStateString.create(navState));
}
}
@@ -633,23 +632,26 @@
*/
static public void setupPublicRenderParams(UIPortlet uiPortlet, Map<String,
String[]> requestParams)
{
- UIPortal uiPortal = Util.getUIPortal();
- Map<String, String[]> publicParams = uiPortal.getPublicParameters();
+ if (ParameterValidation.existsAndIsNotEmpty(requestParams))
+ {
+ UIPortal uiPortal = Util.getUIPortal();
+ Map<String, String[]> publicParams = uiPortal.getPublicParameters();
- for (String key : requestParams.keySet())
- {
- String[] value = requestParams.get(key);
- if (uiPortlet.supportsPublicParam(key))
- {
- if (value.length > 0)
- {
- publicParams.put(key, value);
- }
- else
- {
- publicParams.remove(key);
- }
- }
+ for (String key : requestParams.keySet())
+ {
+ String[] value = requestParams.get(key);
+ if (uiPortlet.supportsPublicParam(key))
+ {
+ if (value.length > 0)
+ {
+ publicParams.put(key, value);
+ }
+ else
+ {
+ publicParams.remove(key);
+ }
+ }
+ }
}
}
Show replies by date