例外をスローできるボタンの例を次に示します。
<h:commandButton value="save" update=":formTable:tableData">
<f:setPropertyActionListener value="BTN_ONE"
target="#{tamplateTableBean.buttonSelected}" />
</h:commandButton>
私ExceptionHandler
は持っています:
FacesContext.getCurrentInstance().getExternalContext().redirect("error.xhtml");
(上記の例のように)使用<h:commandButton>
して例外が発生すると、リダイレクトが実行され、エラーページが表示されます。を使用する<p:commandButton>
と、(行が実行されても)リダイレクトは行われずredirect("error.xhtml")
、何も起こらなかったかのように同じページにとどまります。例外は myExceptionHandler
でキャッチされますが、JSF エラー ページが表示されません。
これはどのように発生し、どうすれば解決できますか?