复合组件的Validator验证,但也抛出异常

时间:2010-12-02 12:38:33

标签: validation jsf jsf-2 composite-component

我想将验证器附加到复合组件,我希望它附加到内部的每个子组件:

<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'.

我怎样才能摆脱这条消息?

0 个答案:

没有答案