Try to place this following code in the error page it iwll dispaly the relevant msg
<%@ page isErrorPage="true" %>
<%-- work out the error page location --%>
<%
String errorPageLocation="eg.html";
if(exception instanceof NullPointerException)
{
errorPageLocation=request.getContextPath()+"somerelevant.html";
}
else if(exception instanceof
IllegalStateException)
{
String msg=exception.getMessage();
System.out.println("error.jsp:: the message is: "+msg);
</head>
<body>
<script>
document.location='<%= errorPageLocation %>'
</script>
</body>
</html>