通过本文主要向大家介绍了jsp 出错,eclipse创建jsp出错,jsp异常处理,jsp乱码处理,jsp如何处理响应信息等相关知识,希望对您有所帮助,也希望大家支持linkedu.com www.linkedu.com
以下页面将产生一个例外:
<%@ 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>
</div>
<%@ 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>
</div>