JSF 1.2 Action 和 ActionListener 中的异常之间的区别

发布于 2024-09-26 11:25:01 字数 98 浏览 1 评论 0原文

我注意到 JSF 1.2。当actionListener方法中抛出异常时不返回错误页面,但当action方法中抛出异常时返回错误页面。这是为什么?在这两种情况下它都能返回错误页面吗?

I've noticed that JSF 1.2. does not return error page when an exception was thrown in actionListener method but does return error page when an exception was thrown in action method. Why is that? Can it return error page in both cases?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

惜醉颜 2024-10-03 11:25:01

FacesEvent侦听器方法被静默捕获并包装在 AbortProcessingException 并记录到控制台。这正是按照规范。

ActionEvent 侦听器方法(与任何其他 FacesEvent 侦听器方法一样)不负责导航任务。真正的行动方法有。一般来说,只有当您想要观察操作调用时才应使用操作侦听器方法,而不是执行某些业务任务(这会影响响应)。

Any exception which is thrown in a FacesEvent listener method is silently caught and wrapped in a AbortProcessingException and logged to the console. That's just as per the specification.

The ActionEvent listener method (as any other FacesEvent listener method) has no responsibility for navigational tasks. The real action method has. Generally, the action listener method should only be used whenever you want to observe an action invoke, not to execute some business task (which affects the response).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文