カスタムバリデータを実装する新しいカスタムコンポーネントを作成しました。問題はその{0}
あるカスタムバリデータにラベルを表示
the.error.message={0}\: is Invalid.
:ここに は、私はそれを呼び出す方法です:
<p:inputText value="#{MyBean.value}" >
<f:attribute name="label" value="#{ResourceBean.labels['label']}"/>
<my:validator error="#{ResourceBean.message['the.error.message']}"
expression="#{ResourceBean.regExp['alphanumeric']}"/>
</p:inputText>
そして、ここで検証の実装です
String val = value == null ? "" : value.toString();
if (!val.matches(getExpression())) {
throw new ValidatorException(new
FacesMessage(FacesMessage.SEVERITY_ERROR,getErrorSummary(),null));
とプロパティファイルにエラーメッセージエラーメッセージのラベルに置き換えられないため、エラーメッセージとして表示されます。
{0}: is Invalid.
これを修正する方法はありますか?