当操作方法引发异常时,它显示为 PropertyNotFoundException
我们的应用程序基于 JSF2,我们正在为此设计异常处理。我尝试使用在faces-config.xml 中配置的JSF2 异常处理框架。
当我从 Facelets 页面中引用的支持 bean 抛出一个空指针时,它会以 javax.el.PropertyNotFoundException
的形式进入异常处理函数,并且它没有任何其他堆栈跟踪。
有没有办法获得异常的确切原因和堆栈跟踪?
Our application is JSF2 based and we are desiging a exception handling for that. I tried using JSF2 exception handling framework configured in faces-config.xml
.
When I throw a null pointer from backing bean, which is referred in Facelets page, then it is coming to exception handling function as javax.el.PropertyNotFoundException
and also it doesn't have any other stack trace about.
Is there any way to get the exact cause of the exception and the stack trace?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
当从复合组件内部调用操作方法时,就会发生这种情况。这已被报告为 JSF 问题 1806,计划在 JSF 2.2 中修复。
到目前为止,还没有办法在异常处理程序中找到根本原因,因为它已经被完全吞没了。最好的选择是使用单独的记录器,或者作为一种巧妙的解决方法,自己将异常作为请求属性传递。
That will happen when the action method is called from inside a composite component. This is already been reported as JSF issue 1806 which is scheduled to be fixed for JSF 2.2.
As far now, there's no way to get the root cause in the exception handler, because it's completely swallowed. Your best bet is using a separate logger or, as a hacky workaround, to pass the exception as a request attribute yourself.
启用开发模式通常会提供更好的错误信息。
将以下内容添加到您的 web.xml 中。
但是,您应该在制作时关闭此功能。
Enabling the Development mode usually gives better error information.
Add the following to your web.xml.
However you should turn this off for your production.