logger.warn("Failed to parse request.", e);
return;
}
HttpRequest request = new HttpRequest(req, headers, uriInfo, method);
HttpResponse response = new HttpResponse(res);
boolean localeInitializedByServlet = false;
try
{
localeInitializedByServlet = initUserLocaleResolver(request);
MethodReturn methodReturn = RestDispatcher.dispatch(request, response, false);
if (!response.isCommitted())
{
HttpUtil.writeResponse(request, response, methodReturn);
}
}
catch (RestFailure e)
{
response.sendException(e.getResponseCode(), e.getResponseMessage());
logger.error(e.getMessage(), e);
}
catch (Exception e)
{
response.sendException(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "Server error processing request.");
logger.error(e.getMessage(), e);
}
finally
{
if (localeInitializedByServlet)