Our tester has been trying to get <f:validateBean> working with
composite components and the "for" attribute, for example:

<ex:ExampleComposite id="example1" managedBean="#{beanValidation}">
  <f:validateBean for="example1:input"/>
</ex:ExampleComposite>

So in reality the bean validation is happening for
#{cc.attrs.beanValidation.value}.  When we execute the bean validation
code, we get an error complaining that our bean has no property named
"attrs".  Digging around, I see that eventually we're calling
LocationValueExpressionUEL.getValueReference() to get the value
reference which in turn calls ValueExpressionImpl.getValueReference().
 The ValueReference we get back correctly finds the managed bean, but
the property is "attrs", when it should be "value".  Digging around
some more, it looks like the root of the problem is in the Apache EL
code, in AstValue.getValueReference():

return new ValueReference(t.base, this.jjtGetChild(1).getValue(ctx));

I suspect getting the first child is the reason we get back "attrs".
So, it seems to me that this code is broken in the case of composite
components.  Where should this problem be fixed?  Should there be some
hack to get the full expression string (how?) and chop off
"cc.attrs.<bean name>." in _BeanValidatorUELUtils?  Or can this be
fixed in the Apache EL code?

Thanks,


Curtiss Howard

Reply via email to