isErrorPage 属性
默认是false
在错误处理界面内
若isErrorpage= "true", jsp内置对象exception可以捕捉到错误信息 exception.toString().
errorPage属性
errorPage= "jsp文件的相对路径"。
<%@ page language="java" contentType="text/html; charset=utf-8"
pageEncoding="utf-8" errorPage="error.jsp" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Insert title here</title>
</head>
<body>
<h1>this is error</h1>
<%
int a = 8;
int b = 0;
int c = a/b;
%>
<%=c%>
</body>
</html>
<%@ page language="java" contentType="text/html; charset=utf-8"
pageEncoding="utf-8" isErrorPage="true"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Insert title here</title>
</head>
<h1>this is show error</h1>
<body>
<%=exception.toString() %>
<%=exception.getMessage() %>
</body>
</html>