Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » JSP error page doesn't work in eclipse internal browser but works in chrome(JSP error page using isErrorPage="true" doesn't show up in eclipse internal browser, but works fine in Chrome.)
JSP error page doesn't work in eclipse internal browser but works in chrome [message #1755534] Sun, 05 March 2017 07:26
Pratiksha Jain is currently offline Pratiksha JainFriend
Messages: 1
Registered: March 2017
Junior Member
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.
Previous Topic:JDT - MarkerResolution - How to show HTML content in Proposal window
Next Topic:JUnit Plug-In Test is run over and over again
Goto Forum:
  


Current Time: Tue Nov 21 02:47:45 GMT 2017

Powered by FUDForum. Page generated in 0.01590 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software