<h:messages>
に基づいて条件付きでレンダリングするだけUIForm#isSubmitted()
です。
<h:form binding="#{form1}">
<h:messages rendered="#{form1.submitted}" />
...
</h:form>
<h:form binding="#{form2}">
<h:messages rendered="#{form2.submitted}" />
...
</h:form>
<h:form binding="#{form3}">
<h:messages rendered="#{form3.submitted}" />
...
</h:form>
または、ajaxの魔法を取り入れて、ビュー全体ではなく現在のフォームのみを更新します。
<h:form>
<h:messages />
...
<h:commandButton ...><f:ajax execute="@form" render="@form" /></h:commandButton>
</h:form>
<h:form>
<h:messages />
...
<h:commandButton ...><f:ajax execute="@form" render="@form" /></h:commandButton>
</h:form>
<h:form>
<h:messages />
...
<h:commandButton ...><f:ajax execute="@form" render="@form" /></h:commandButton>
</h:form>
そのため、検証後にプレゼンテーション層に送信されるエラーメッセージを処理し、JS/Jqueryを使用して自分でエラープレゼンテーションタスクを実行したいと思います。
を置き換えるカスタムコンポーネントまたはレンダラーを作成します<h:messages>
。