If I send a HTTP status code and a message like
response.sendError(404, “message here”);
how do I reference the message from the associated, error-handling JSP (marked w/ isErroPage=true)?
None of these approaches work:
- ${pageContext.errorData.throwable.message}
- How to get the message in a custom error page (Tomcat)?
Answered: What is the simplest way to display httpServletResponse.sendError(403, “My Message”) status from JSTL
<%= request.getAttribute("javax.servlet.error.message") %>${requestScope['javax.servlet.error.message']}