[Jweb] JSP-编程 01 (Directive-page)

TestErr.jsp
<%@page errorPage="ErrPage.jsp"%>
<%
String s="123Plus";
int i=Integer.parseInt(s);
out.println("s=" + s + "  i=" + i);
%>
ErrPage.jsp
<%-- ********* ErrPage.jsp ********** --%>
<%@ page contentType="text/html;charset=gb2312" %>
<%@ page isErrorPage="true" %>
<HTML>
<BODY TEXT="red">

错误信息:<%= exception.getMessage() %>
</BODY>
</HTML>


原文地址:https://www.cnblogs.com/robbychan/p/3786865.html