admin管理员组文章数量:1321246
I'm trying to configure my Jetty 12 server to forward requests to an "/error" page for all error scenarios, including those occurring before servlet initialization (e.g., during early request processing).
I've successfully configured error handling for ServletContextHandler/WebAppContext using ErrorHandler, but I'm unclear how to handle errors that occur earlier in the request lifecycle.
Current Approach:
I believe I need to set a global error handler via Server.setErrorHandler()
, potentially using either: Jetty's ByHttpStatus
error handler or a custom ReHandlingErrorHandler
.
Key Question:
What should be passed as the handler
parameter to ReHandlingErrorHandler
constructor? The Jetty test suite uses the Server object itself, but is this production-safe? Could this cause infinite recursion if the error handling process itself fails?
ReHandlingErrorHandler errorHandler = new ReHandlingErrorHandler(/* what goes here? */);
server.setErrorHandler(errorHandler);
本文标签: How to Configure Global Error Handling in Jetty Server for PreServlet ErrorsStack Overflow
版权声明:本文标题:How to Configure Global Error Handling in Jetty Server for Pre-Servlet Errors - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742035159a2417208.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论