On Wed, Feb 2, 2011 at 2:40 PM, Andy Schwartz <andy.schwartz@oracle.com> wrote:
Gang -

I recently triaged a bug that complained that the "type" attribute of <cc:attribute> was not behaving correctly.  The user expected the following attribute specification:

 <cc:attribute name="foo" type="java.lang.Integer"/>

To result in a warning/error when used as follows:

 <comp:bar foo="MostDefinitelyNotAnInteger"/>

This seems like a reasonable expectation.  An equivalent test case using, for example, JSP tag files does result in an error.

This raises a few questions:

1.  Should JSF implementations be making use of composite component metadata (like "type") at runtime to enforce the intentions of the composite component author?

Yes, assuming this can be done without sacrificing performance.
 
2.  Should this behavior be specified?

Yes.

3.  Are there other places where we have similar metadata (eg. Facelets taglib.xml files) that we should review as well?

Yes. I think in any case where we have type information about parameters (or even the # of parameters), we should enforce it. This is one of the issues people run into a lot when using Facelet compositions (not composite components).

Andy