我想将验证器附加到复合组件,我希望它附加到内部的每个子组件:
<cc:interface>
<cc:attribute name="validator"
method-signature="void f(javax.faces.context.FacesContext,
javax.faces.component.UIComponent,
java.lang.Object)"
targets="child1 child2"/>
<cc:editableValueHolder name="child1"/>
<cc:editableValueHolder name="child2"/>
</cc:interface>
<cc:implementation>
<h:inputText id="child1"/>
<h:inputText id="child2"/>
</cc:implementation>
所以在页面上我有:
<xxx:mycomponent validator="#{bean.validationMethod}"/>
验证按预期工作,但JSF也会抛出一条消息:
..../form.xhtml validator="#{bean.validationMethod}": The class 'my.package.Bean' does not have the property 'validationMethod'.
我怎样才能摆脱这条消息?