In the request, you can get the attributes set by the container in case of an error:
request.getAttribute("javax.servlet.error.request_uri");
other attributes that may provide useful information;
javax.servlet.error.status_code
javax.servlet.error.exception_type
javax.servlet.error.message
javax.servlet.error.exception
. 2.3 .