JSP errorPage設置方法
更新時間:2009年10月04日 15:46:32 作者:
JSP errorPage設置方法,大家可以參考下。
1.設置errorPage:errorPage.jsp
<%@page isErrorPage="true"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
Error~!
<%=exception.getMessage()%>
</body>
</html>
2.應用
<%@page info="Bad page"%>
<%@page errorPage="errorPage.jsp" %> //出錯后轉(zhuǎn)到
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<%
boolean tf = true;
if(tf){
String info = getServletInfo();
throw new Exception("Exception in:" + info);
}
%>
</body>
</html>
復制代碼 代碼如下:
<%@page isErrorPage="true"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
Error~!
<%=exception.getMessage()%>
</body>
</html>
2.應用
復制代碼 代碼如下:
<%@page info="Bad page"%>
<%@page errorPage="errorPage.jsp" %> //出錯后轉(zhuǎn)到
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<%
boolean tf = true;
if(tf){
String info = getServletInfo();
throw new Exception("Exception in:" + info);
}
%>
</body>
</html>
相關(guān)文章
JSP指令元素(page指令/include指令/taglib指令)復習整理
JSP指令元素部分(page指令、include指令、taglib指令),今天抽時間復習了一下,并對心得進行了整理,下面與大家分享下,希望對大家學習jsp有所幫助2013-07-07
jsp+mysql實現(xiàn)網(wǎng)頁的分頁查詢
這篇文章主要為大家詳細介紹了jsp+mysql實現(xiàn)網(wǎng)頁的分頁查詢,文中示例代碼介紹的非常詳細,具有一定的參考價值,感興趣的小伙伴們可以參考一下2022-02-02
JSP頁面IE無法打開Internet 站點…… 已終止操作 的解決方法
今天機緣巧合之下遇到了個人認為比較經(jīng)典的“IE無法打開Internet 站點…… 已終止操作”的問題。2013-05-05

