以下页面将产生一个例外:
<%@ page errorPage="errorpge.jsp" %>
<HTML>
<HEAD>
<TITLE>JSP 1.0 Error Page Demo</TITLE>
</HEAD>
<BODY>
<H1>JSP 1.0 Error Page Demo</H1>
<%
String s = null;
s.getBytes(); //这将给出 NullPointException例外
%>
</BODY>
</HTML>
在出错后以下页面被调用:
<html>
<body bgcolor="black" text="#FFFFFF">
<%--@ page isErrorPage="true" --%>
<h1> Attenion the fellowing error occurs</h1><br>
<pre><%= exception.getMessage() %></pre>
</body>
</html>
最后
以上就是谦让月光最近收集整理的关于JSP的出错处理的全部内容,更多相关JSP内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复