Struts“org.apache.struts.action.RequestProcessor - 抛出未处理的异常” - 如何获得完整的堆栈跟踪?
有时,在开发过程中我得到:
[http-8080-6] WARN org.apache.struts.action.RequestProcessor - Unhandled Exception thrown:"...
from struts.
当它重现时,我正在调试它并找到问题,但是,如果我无法重现,我将永远不知道我的应用程序中隐藏了哪些错误。
有没有办法告诉struts以调试模式或其他模式运行,以便它始终显示异常的完整堆栈跟踪?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
最好的选择是配置一个全局异常处理程序。如果您需要完全不同的处理,请实现
ExceptionCatcher
或ExceptionHandler
。在 S1.2 中,情况类似,但您需要在自定义 processException rel="nofollow">请求处理器。(最好指出您正在使用的版本 - S1.2 和 S1.3 请求处理器是不同的。)
Your best bet is to configure a global exception handler. If you need substantially different handling, implement an
ExceptionCatcher
orExceptionHandler
. In S1.2 it's similar, but you'd overrideprocessException
in a custom request processor.(It's always best to indicate what version you're using--S1.2 and S1.3 request processors are different.)