You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by mf...@apache.org on 2010/02/17 19:39:05 UTC
svn commit: r911143 -
/myfaces/portlet-bridge/core/trunk_2.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/bridge/BridgeImpl.java
Author: mfreedman
Date: Wed Feb 17 18:39:05 2010
New Revision: 911143
URL: http://svn.apache.org/viewvc?rev=911143&view=rev
Log:
PORTLETBRIDGE-121: Exception thrown if PRP bean in PRP mapping doesn't exist.
Modified:
myfaces/portlet-bridge/core/trunk_2.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/bridge/BridgeImpl.java
Modified: myfaces/portlet-bridge/core/trunk_2.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/bridge/BridgeImpl.java
URL: http://svn.apache.org/viewvc/myfaces/portlet-bridge/core/trunk_2.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/bridge/BridgeImpl.java?rev=911143&r1=911142&r2=911143&view=diff
==============================================================================
--- myfaces/portlet-bridge/core/trunk_2.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/bridge/BridgeImpl.java (original)
+++ myfaces/portlet-bridge/core/trunk_2.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/bridge/BridgeImpl.java Wed Feb 17 18:39:05 2010
@@ -2074,20 +2074,23 @@
// now evaluate the expression
ValueExpression valExpr = app.getExpressionFactory().createValueExpression(context.getELContext(),
expr, String.class);
- String curVal = (String) valExpr.getValue(context.getELContext());
- // Only update if new value
- // In EL can't distinguish between null and empty string
- if (curVal != null && curVal.length() > 0)
+
+ try
{
- try
+ String curVal = (String) valExpr.getValue(context.getELContext());
+ // Only update if new value
+ // In EL can't distinguish between null and empty string
+ if (curVal != null && curVal.length() > 0)
{
valExpr.setValue(context.getELContext(), null);
+ paramsMapped = true;
}
- catch (Exception ex)
- {
- ex.printStackTrace();
- }
- paramsMapped = true;
+ }
+ catch (Exception ex)
+ {
+ // Note: expression may not evaluate because PRP mappings are in face-config.xml and multiple portlets
+ // may be sharing -- hence this portlet may not have an expression mapping
+ ;
}
}
}
@@ -2121,23 +2124,31 @@
// now evaluate the expression
ValueExpression valExpr = app.getExpressionFactory().createValueExpression(context.getELContext(),
expr, String.class);
- String value = (String) valExpr.getValue(context.getELContext());
-
- // only set in response if the value has changed
- Map<String, String[]> m = request.getPublicParameterMap();
- if (value != null)
- {
- String[] requestVals = m.get(s);
- // only set if the values are different
- if (requestVals == null || !requestVals[0].equals(value))
+ try
+ {
+ String value = (String) valExpr.getValue(context.getELContext());
+
+ // only set in response if the value has changed
+ Map<String, String[]> m = request.getPublicParameterMap();
+ if (value != null)
+ {
+ String[] requestVals = m.get(s);
+ // only set if the values are different
+ if (requestVals == null || !requestVals[0].equals(value))
+ {
+ response.setRenderParameter(s, value);
+ }
+ }
+ // see if we need to remove it
+ else if (m.containsKey(s))
{
- response.setRenderParameter(s, value);
+ response.removePublicRenderParameter(s);
}
}
- // see if we need to remove it
- else if (m.containsKey(s))
+ catch (Exception exception)
{
- response.removePublicRenderParameter(s);
+ // Do nothing
+ ;
}
}
}