I have a jsp page which can throw some exceptions. I have another JSP page - catchError.jsp this should be displayed whenever the exception occurs in any of the JSP pages.
I have added below code into catchError.jsp
<%@ page isErrorPage="true" %>
And my JSP page - displayDetails.jsp has below code, here I have introduced arithmetic exception for demo purpose.
<%@ page errorPage="catchError.jsp" %>
<% int div = 10/ 0; %>
I am getting null pointer exception whenever I am trying to access displayDetails.jsp. It should throw arithmetic exception ideally, which will then get redirected to catchError.jsp.
stack trace:
org.springframework.web.util.NestedServletException: View rendering failed; nested exception is java.lang.NullPointerException
javax.portlet.PortletException: org.springframework.web.util.NestedServletException: View rendering failed; nested exception is java.lang.NullPointerException
Per my guess, the system is unable to find catchError.jsp in error page attribute itself. Any reason why this is happening and any suggestion on how I can proceed.