<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/3.26.0">
</HEAD>
<BODY>
I've logged an issue for this:<BR>
<A HREF="https://javaserverfaces.dev.java.net/issues/show_bug.cgi?id=1360">https://javaserverfaces.dev.java.net/issues/show_bug.cgi?id=1360</A><BR>
<BR>
<BR>
When baseClass is:<BR>
&nbsp;&nbsp;&nbsp; class com.sun.faces.el.CompositeComponentAttributesELResolver$ExpressionEvalMap<BR>
<BR>
BeanValidator.isResolvable(...) returns false because ExpressionEvalMap is a Map -- and never attempts to traverse the composite component.<BR>
<BR>
This is a big problem with Bean Validation support, since probably the most attractive feature of JSF2 is composite components, and this means BeanValidation will not function at all within any composite components.<BR>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // case 1, base classes of Map, List, or Array are not resolvable<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (null != <B>baseClass</B>) {<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (<B>Map.class.isAssignableFrom(baseClass)</B> ||<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Collection.class.isAssignableFrom(baseClass) ||<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Array.class.isAssignableFrom(baseClass)) {<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; failureMessage = &quot;<B>Unable to validate expression &quot; + valueExpression.getExpressionString() +</B><BR>
<B>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot; using Bean Validation.&nbsp; Expression evaluates to a Map, List or array.&quot;;</B><BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; result = false;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>
<BR>
<BR>
<B>This can be reproduced by using the following component, and an Object annotated with JSR303 annos.</B><BR>
Consuming page: (I've also tried &quot;value&quot; as the for=&quot;...&quot; attribute value with no success)<BR>
<BR>
<BLOCKQUOTE>
    &lt;h:form&gt;<BR>
    <BLOCKQUOTE>
        &lt;a:comp id=&quot;test&quot; value=&quot;${bean.test.text}&quot;&gt;<BR>
                &lt;f:validateBean for=&quot;#{bean.test}&quot;/&gt;<BR>
        &lt;/a:comp&gt;<BR>
    </BLOCKQUOTE>
    &lt;/h:form&gt;<BR>
</BLOCKQUOTE>
<BR>
<B>Example component:</B><BR>
<BR>
<BLOCKQUOTE>
    &lt;html xmlns=&quot;<A HREF="http://www.w3.org/1999/xhtml">http://www.w3.org/1999/xhtml</A>&quot;<BR>
            xmlns:h=&quot;<A HREF="http://java.sun.com/jsf/html">http://java.sun.com/jsf/html</A>&quot;<BR>
            xmlns:f=&quot;<A HREF="http://java.sun.com/jsf/core">http://java.sun.com/jsf/core</A>&quot;<BR>
            xmlns:a=&quot;<A HREF="http://java.sun.com/jsf/composite/ajax">http://java.sun.com/jsf/composite/ajax</A>&quot;<BR>
            xmlns:ui=&quot;<A HREF="http://java.sun.com/jsf/facelets">http://java.sun.com/jsf/facelets</A>&quot;<BR>
            xmlns:composite=&quot;<A HREF="http://java.sun.com/jsf/composite">http://java.sun.com/jsf/composite</A>&quot;&gt;<BR>
    <BR>
    &lt;composite:interface&gt;<BR>
            &lt;composite:attribute name=&quot;value&quot; required=&quot;true&quot; type=&quot;Object&quot; /&gt;<BR>
            &lt;composite:editableValueHolder name=&quot;value&quot; targets=&quot;value&quot; /&gt;<BR>
    &lt;/composite:interface&gt;<BR>
    <BR>
    &lt;composite:implementation&gt;<BR>
            &lt;h:message id=&quot;inputErr&quot; for=&quot;input&quot;/&gt;&lt;br/&gt;<BR>
            &lt;h:inputText id=&quot;input&quot; value=&quot;#{cc.attrs.value}&quot; &gt;<BR>
                    &lt;f:ajax execute=&quot;@this&quot; render=&quot;@this inputErr&quot; /&gt;<BR>
            &lt;/h:inputText&gt;<BR>
    &lt;/composite:implementation&gt;<BR>
    <BR>
    &lt;/html&gt;<BR>
</BLOCKQUOTE>
<BR>
<B>Example Object:</B><BR>
<BR>
<BLOCKQUOTE>
    public class ValidationCriteria<BR>
    {<BR>
    &nbsp;&nbsp;&nbsp; @Size(min=4, max=255)<BR>
    &nbsp;&nbsp;&nbsp; private String text;<BR>
    <BR>
    &nbsp;&nbsp;&nbsp; public String getText()<BR>
    &nbsp;&nbsp;&nbsp; {<BR>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return text;<BR>
    &nbsp;&nbsp;&nbsp; }<BR>
    <BR>
    &nbsp;&nbsp;&nbsp; public void setText(final String validation)<BR>
    &nbsp;&nbsp;&nbsp; {<BR>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this.text = validation;<BR>
    &nbsp;&nbsp;&nbsp; }<BR>
    }<BR>
    <BR>
</BLOCKQUOTE>
ExampleBean<BR>
<BR>
@ManagedBean<BR>
public class Bean<BR>
{<BR>
&nbsp;&nbsp;&nbsp; private ValidationCriteria test = new ValidationCriteria();<BR>
<BR>
&nbsp;&nbsp;&nbsp; public ValidationCriteria getTest()<BR>
&nbsp;&nbsp;&nbsp; {<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return test;<BR>
&nbsp;&nbsp;&nbsp; }<BR>
}<BR>
<BR>
<BR>
<BR>
<TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<TR>
<TD>
--<BR>
<B>Lincoln Baxter, III</B><BR>
Co-Founder of <A HREF="http://ocpsoft.com">OcpSoft</A><BR>
<BR>
Creator of:<BR>
<A HREF="http://ocpsoft.com/prettyfaces">PrettyFaces</A>: URL rewriting for JSF<BR>
<A HREF="http://ocpsoft.com/prettytime">PrettyTime</A>: Java elapsed timestamp formatting<BR>
<BR>
<BR>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>