Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 344529

Summary: Ability to customize the ErrorHandler for the HttpService
Product: [RT] Jetty Reporter: Hugues Malphettes <hmalphettes>
Component: osgiAssignee: Hugues Malphettes <hmalphettes>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: holger.staudacher, jetty-inbox
Version: 7.4.0   
Target Milestone: 7.4.x   
Hardware: All   
OS: All   
Whiteboard:

Description Hugues Malphettes CLA 2011-05-03 03:24:02 EDT
It is currently not trivial to customize the error handling for the HttpServiceServlet hosted by jetty-osgi.
Comment 1 Hugues Malphettes CLA 2011-05-03 03:32:46 EDT
The goal of this enhancement is to support the ability to have an HttpServlet
handle the errors or to user jetty's ErrorPageErrorHandler's API.

A simple static method would be used to set the servlet or to access the
ErrorPageErrorHandler.
Comment 2 Hugues Malphettes CLA 2011-05-03 03:42:36 EDT
The suggested API is a choice of
- an HttpServlet that is almost agnostic of any jetty internal APIs:
org.eclipse.jetty.osgi.httpservice.HttpServiceErrorHandlerHelper(HttpServlet errorHandlerServlet)
And for example to read the error code:
int errorCode = httpServletRequest.getAttribute(org.eclipse.jetty.server.Dispatcher.ERROR_STATUS_CODE);

- Direct access to the ErrorPageErrorHandler:
org.eclipse.jetty.osgi.httpservice.HttpServiceErrorPageErrorHandler.getInstance()
Comment 3 Holger Staudacher CLA 2011-05-03 04:15:54 EDT
Thanks Hugues for fixing this. This will be a great addition.