myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jak...@apache.org
Subject svn commit: r928233 - /myfaces/core/trunk/api/src/main/java/javax/faces/validator/BeanValidator.java
Date Sat, 27 Mar 2010 17:05:34 GMT
Author: jakobk
Date: Sat Mar 27 17:05:33 2010
New Revision: 928233

URL: http://svn.apache.org/viewvc?rev=928233&view=rev
Log:
MYFACES-2622 BeanValidator has to handle CompositeComponentExpressionHolder when resolving
the ValueExpression

Modified:
    myfaces/core/trunk/api/src/main/java/javax/faces/validator/BeanValidator.java

Modified: myfaces/core/trunk/api/src/main/java/javax/faces/validator/BeanValidator.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/java/javax/faces/validator/BeanValidator.java?rev=928233&r1=928232&r2=928233&view=diff
==============================================================================
--- myfaces/core/trunk/api/src/main/java/javax/faces/validator/BeanValidator.java (original)
+++ myfaces/core/trunk/api/src/main/java/javax/faces/validator/BeanValidator.java Sat Mar
27 17:05:33 2010
@@ -36,6 +36,7 @@ import javax.faces.application.FacesMess
 import javax.faces.component.PartialStateHolder;
 import javax.faces.component.UIComponent;
 import javax.faces.context.FacesContext;
+import javax.faces.el.CompositeComponentExpressionHolder;
 import javax.servlet.ServletContext;
 import javax.validation.ConstraintViolation;
 import javax.validation.MessageInterpolator;
@@ -509,10 +510,20 @@ final class ValueReferenceResolver exten
      * @param elCtx The ELContext, needed to parse and execute the expression.
      * @return The ValueReferenceWrapper.
      */
-    public static ValueReferenceWrapper resolve(final ValueExpression valueExpression, final
ELContext elCtx)
+    public static ValueReferenceWrapper resolve(ValueExpression valueExpression, final ELContext
elCtx)
     {
         final ValueReferenceResolver resolver = new ValueReferenceResolver(elCtx.getELResolver());
-        valueExpression.getValue(new ELContextDecorator(elCtx, resolver));
+        final ELContext elCtxDecorator = new ELContextDecorator(elCtx, resolver);
+        
+        valueExpression.getValue(elCtxDecorator);
+        
+        while (resolver.lastObject.getBase() instanceof CompositeComponentExpressionHolder)
+        {
+            valueExpression = ((CompositeComponentExpressionHolder) resolver.lastObject.getBase())
+                                  .getExpression((String) resolver.lastObject.getProperty());
+            valueExpression.getValue(elCtxDecorator);
+        }
+
         return resolver.lastObject;
     }
 



Mime
View raw message