以下の内容はhttps://anton0825.hatenablog.com/entry/2015/10/24/000000より取得しました。


JSFのValidatorにパラメータを渡す

以下のようにf:attributeタグを使ってオブジェクトをValidatorに渡せる。

<h:inputText>
    <f:validator validatorId="validateEmail" />
    <f:attribute name="foo" value="bar" />
</h:inputText>

Validatorのコードでは以下のようにしてオブジェクトを取得する。

    @Override
    public void validate(final FacesContext context, final UIComponent component, final Object value) throws ValidatorException {
        final Map<String, Object> a = component.getAttributes();
        String foo = (String) a.get("foo");

        ...
    }

参考:




以上の内容はhttps://anton0825.hatenablog.com/entry/2015/10/24/000000より取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14