HttpServletRequest request = (HttpServletRequest) genericRequest;
HttpServletResponse response = (HttpServletResponse) genericResponse;
// Attempt to retrieve the service from OSGi that will dispath requests
// to servlets registered with the HttpService.
HttpBridge bridge = (HttpBridge)
manager.getExportedBridgeService(HttpBridge.class);
if (bridge == null) {
response.sendError(HttpServletResponse.SC_NOT_FOUND,
"Requested resource '" + request.getRequestURI() +
"'could not be found");
return;
}
try {
// Dispatch the request to the bridge.
bridge.dispatch(request, response);
} catch(ServletException e) {
e.printStackTrace();
throw e;
} catch(IOException e) {
e.printStackTrace();