String error_url = (String) request.getAttribute("javax.servlet.error.request_uri");
log.info("Status code " + status_code);
ThreadContext.set(new ThreadContext(request, response, error_url));
switch (status_code) { // TODO: need to cover more status codes? (should match web.xml)
case HttpServletResponse.SC_NOT_FOUND:
website.sendError(status_code, "The requested resource is not found: " + error_url);
ThreadContext.get().getResponse().write(request, response);
break;
case HttpServletResponse.SC_FORBIDDEN:
website.sendError(status_code, "Access to the requested resource is forbidden: " + error_url);
ThreadContext.get().getResponse().write(request, response);