【发布时间】:2012-07-24 13:16:08
【问题描述】:
我正在使用 JSF,带有 @ManagedBean 注释并使用 Primefaces,我遇到了以下问题。
为什么没有触发“onerror”?异常只是出现在我的控制台中。
login.xhtml
<p:commandButton
value="teste"
action="#{loginBean.methodTest()}"
ajax="true"
immediate="false"
onerror="confirmation.show()" />
<p:dialog
appendToBody="true"
header="Atencao"
widgetVar="confirmation"
showEffect="bounce">
...
</p:dialog>
MyBean
@ManagedBean(name = "loginBean")
@SessionScoped
public class LoginBean {
public void methodTest() throws Exception {
System.out.println("hi");
throw new Exception("Exception Test");
}
【问题讨论】:
-
可能是您在操作方法中使用了括号
()吗?取决于您使用的容器,这将不起作用...
标签: jsf primefaces exception-handling dialog onerror