在Eclipse创建Web project name=test,然后写了一个 price.jsp 和一个 excep.jsp                        price.jsp
<%@ page errorPage="excep.jsp"%>
<%
String strPrice=request.getParameter("price");
double price=Double.parseDouble(strPrice);out.println("Total price = "+price*3);
 %>                        excep.jsp
<%@ page isErrorPage="true"%>
<%
out.println("exception.toString():");
out.println("<br/>");
out.println(exception.toString());
out.println("<p>");out.println("exception.getMessage():");
out.println("<br/>");
out.println(exception.getMessage());
%>运行时: http://localhost:8080/Test/price.jsp?price=100
会输出:Total price = 300.0 但是输入: http://localhost:8080/Test/price.jsp?price=abc
出现不了正常的错误页面 提示的是无法显示网页
在 excep.jsp中,任意修改一处地方,运行让tomcat报错,然后在改回来,输入
http://localhost:8080/Test/price.jsp?price=abc
才出现正常的错误页面:exception.toString(): 
java.lang.NumberFormatException: For input string: "abc" 
exception.getMessage(): 
For input string: "abc" 如果再输入http://localhost:8080/Test/price.jsp?price=abcd
有会出现无法显示页面,然后要重复上面的步骤才可以正常的运行错误页面不知道为什么会这样子,希望有高手指点指点,最好告诉我修改代码~~谢谢!