Hello, I am trying out a simple error page using JSPs which should show up in case of any exception. It works fine with Chrome but not working in Eclipse Internal Browser. Can someone please help if i am missing out on anything.
TestErrorPage.jsp
<%@page isErrorPage="false" errorPage="error.jsp" %>
<%
String num1=request.getParameter("n1");
String num2=request.getParameter("n2");
int a=Integer.parseInt(num1);
int b=Integer.parseInt(num2);
int c=a/b;
%>
error.jsp
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1" isErrorPage="true"%>
<%
System.out.println("in Error Page");
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Error page</title>
</head>
<body>
<h3>Sorry an exception occurred!</h3>
Exception is: <%=exception %>
</body>
</html>
web.xml
<error-page>
<error-code>500</error-code>
<location>/error.jsp</location>
</error-page>
<error-page>
<exception-type>java.lang.Exception</exception-type>
<location>/error.jsp</location>
</error-page>
If i give n2 as 0 and run this using Eclipse internal browser, it show the System.out i have given in error.jsp, but the error page doesn't get displayed whereas it works fine in Chrome.
Is there any thing in the code i am missing or is there any setting to enable this. If someone could please help. Thanks.