error.jsp

来自「jsp+javabean写的论坛」· JSP 代码 · 共 50 行

JSP
50
字号
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" isErrorPage="true"%>
<%
String errorCode=request.getParameter("code");
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link href="css/index.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>错误页面</title>
</head>
<body>
<jsp:include page="include/top.htm"/>
<table width="95%"  border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#000000">
  <tr>
    <td bgcolor="#99cc66">发生错误!可能的出错原因如下</td>
  </tr>
  <tr>
    <td height="50" bgcolor="#e7e7e7">原因:
	<%
	if(errorCode!=null&&errorCode.equals("FileNotFoundException"))
	{
		out.print("文件未找到");
	}
	if(errorCode!=null&&errorCode.equals("SQLException"))
	{
		out.print("数据库发生错误");
	}
	if(errorCode!=null&&errorCode.equals("ClassNotFoundException"))
	{
		out.print("类文件无法加载");
	}
	if(errorCode!=null&&errorCode.equals("FileNotFoundException"))
	{
		out.print("文件未找到");
	}
	if(errorCode!=null&&errorCode.equals("UsernameOrPasswordErrorException"))
	{
		out.print("用户名或密码错误");
	}
	if(errorCode!=null&&errorCode.equals("UnknownException"))
	{
		out.print("未知错误");
	}
	%>	</td>
  </tr>
</table><jsp:include page="include/bottom.htm"/>
</body>
</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?