?? message.jsp
字號:
<%@ page language="java" import="java.util.*" pageEncoding="gb2312"%>
<%@page import="Dao.DBAccessException"%>
<html>
<head>
<script language=javascript type="text/JavaScript">
function showdetail() {
if (exdetail.style.display == "") {
exdetail.style.display = "none";
} else {
exdetail.style.display = "";
}
}
</script>
</head>
<%!
private static final char[] ERROR_CHR ={'&', '"', '\''};
// 去除字符串中不能在表單中出現的字符
//@param inStr String 要處理的字符串
//@return String 處理后的字符串
public String toFormStr(String inStr)
{
String returnStr = new String(inStr != null ? inStr : "");
for (int i = 0; i < ERROR_CHR.length; i++) {
returnStr = returnStr.replaceAll("[" + (ERROR_CHR[i] == '\\' ? "\\\\" :
String.valueOf(ERROR_CHR[i])) + "]", "");
}
return returnStr;
}
%>
<body>
<table width="75%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr><td colspan="5" height="5"></td></tr>
<tr>
<td width="39"><img src="images/title_01.gif"></td>
<td width="150" background="images/title_02.gif" valign="baseline" class="title"><div align="center">系統(tǒng)提示</div></td>
<td width="22"><img src="images/title_03.gif"></td>
<td background="images/title_04.jpg"> </td>
<td width="330" background="images/title_04.jpg">
</td>
</tr>
<tr><td colspan="5" height="5"></td></tr>
<%
Exception ex = (Exception)request.getAttribute("message");
System.out.println(ex.getMessage());
Exception oex = null;
StackTraceElement[] ss = null;
String msg = null;
String omsg = null;
String exn = null;
if (ex != null)
{
boolean showSS = true;
if (DBAccessException.class.isInstance(ex))
{
oex = ((DBAccessException)ex).getOldException();
if (oex != null)
{
ss = oex.getStackTrace();
omsg = oex.getMessage();
exn = oex.getClass().getName();
}
else
{
showSS = false;
}
}
if (ss == null && showSS)
{
ss = ex.getStackTrace();
exn = ex.getClass().getName();
}
msg = ex.getMessage();
}
if (msg == null || msg.equals(""))
{
msg = "發(fā)生不明錯誤!";
}
%>
</table>
<table width="75%" border=1 align="center" cellpadding="1" cellspacing="0" bordercolor="BBBBBB" bgcolor="FFFFFF">
<tr>
<td align="center" class="td_">
<br><%=msg%><br><br>
</td>
</tr>
<tr>
<td height="25"><div align="center">
<input type="button" value=" 返回 " onclick='history.back(1)'>
<% if (ss != null) {%>
<input type="button" name="btndetail" class="button" value=" 詳細信息 " onclick='showdetail()'>
<%} %>
</div></td>
</tr>
<tr style="display:none" id="exdetail">
<td align="center" class="td_">
<% if (omsg != null)
{%>
<br><%=omsg%><br><br>
<% }%>
<textarea cols='81' rows='25' wrap='off' readonly>
<% if (ss != null) {
out.print(exn+" at:\n");
for (int i = 0; i < ss.length; i++) {
out.print(" "+toFormStr(ss[i].toString())+"\n");
}
}%>
</textarea>
<br><br></td>
</tr>
</table>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -