Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 344529 - Ability to customize the ErrorHandler for the HttpService
Summary: Ability to customize the ErrorHandler for the HttpService
Status: RESOLVED FIXED
Alias: None
Product: Jetty
Classification: RT
Component: osgi (show other bugs)
Version: 7.4.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 7.4.x   Edit
Assignee: Hugues Malphettes CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-03 03:24 EDT by Hugues Malphettes CLA
Modified: 2011-05-03 04:15 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.