Jsf 所需的复合组件=";“真的”;不受尊重

Jsf 所需的复合组件=";“真的”;不受尊重,jsf,jsf-2,attributes,composite-component,required,Jsf,Jsf 2,Attributes,Composite Component,Required,在composite:接口中,我定义了如下属性: <composite:attribute name="myAttribute" required="true"/> 现在,当我像这样使用复合组件时,不定义任何属性: <myTag:myCC/> 我预计会发生错误。没有。我可能遗漏了什么?只有当您的JSF项目阶段设置为Development时,才会出现这种情况,如web.xml中所示: <context-param> <param-nam

在composite:接口中,我定义了如下属性:

<composite:attribute name="myAttribute" required="true"/>

现在,当我像这样使用复合组件时,不定义任何属性:

<myTag:myCC/>


我预计会发生错误。没有。我可能遗漏了什么?

只有当您的JSF项目阶段设置为
Development
时,才会出现这种情况,如
web.xml
中所示:

<context-param>
    <param-name>javax.faces.PROJECT_STAGE</param-name>
    <param-value>Development</param-value>
</context-param>
javax.faces.view.facelets.TagException: /test.xhtml @22,19 <my:composite> The following attribute(s) are required, but no values have been supplied for them: foo. 
    at com.sun.faces.facelets.tag.composite.InterfaceHandler.validateComponent(InterfaceHandler.java:232)
    at com.sun.faces.facelets.tag.composite.InterfaceHandler.apply(InterfaceHandler.java:125)
    at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:95)
    ...