I was assuming the output as : Inside the catch There was an exception java.lang.NullPointerException Output of errorPage.jsp because of exception caused in line #1
But the output is only containing the output from errorPage.jsp as divide by zero comes. When I remove the code that caused divide by zero then only the NPE comes. I see the divide by zero exception supersedes the NPE. One more thing: Even if I don't write <%@page errorPage ="errorPage.jsp"%> in the badPage.jsp, it works for divide by zero exception.
I am using apache-tomcat-5.5.23
[ June 02, 2007: Message edited by: Chandra Bhatt ]
[ June 02, 2007: Message edited by: Chandra Bhatt ] [ June 02, 2007: Message edited by: Chandra Bhatt ]
Still I am not getting why the previous exception message is not shown on my web page. As in above case, I am only getting the last exception caused as divide by zero and the exception I caught inside the catch is lost. I also tried to define the error page for NPE in DD.
Actually the idea didn't come in my head, that the errorPage will be called dynamically in case exception occurs, so the previous page content will be superseded by the further page that is called when next exception is generated.
Note: I didn't write the <%@ page isErrorPage="true"%> on the top of the errorPage and still it is treated as error page. Can somebody guide me to understand the issue.