How to get the message in a custom error page (Tomcat)?

The error message is available via javax.servlet.error.message attribute of the request object in error page jsp.

Here is the jsp syntax to access it:

<c:out value="${requestScope['javax.servlet.error.message']}"/>

You could look for other error related information available in the error page here under New Error Attributes.

Leave a Comment