JSP errorPage設(shè)置方法
更新時(shí)間:2009年10月04日 15:46:32 作者:
JSP errorPage設(shè)置方法,大家可以參考下。
1.設(shè)置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.應(yīng)用
<%@page info="Bad page"%>
<%@page errorPage="errorPage.jsp" %> //出錯(cuò)后轉(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>
復(fù)制代碼 代碼如下:
<%@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.應(yīng)用
復(fù)制代碼 代碼如下:
<%@page info="Bad page"%>
<%@page errorPage="errorPage.jsp" %> //出錯(cuò)后轉(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)文章
兩個(gè)JSP頁面父頁面獲取子頁面內(nèi)容的兩種方法
兩個(gè)JSP頁面,父頁面需要子頁面的內(nèi)容,但子頁面是隱藏的,本文介紹兩種解決方案,比較實(shí)用2014-10-10JSP 開發(fā)之Struts2內(nèi)建自定義攔截器
這篇文章主要介紹了JSP 開發(fā)之Struts2內(nèi)建自定義攔截器的相關(guān)資料,需要的朋友可以參考下2017-04-04JSP開發(fā)Servlet重寫init()方法實(shí)例詳解
這篇文章主要介紹了JSP開發(fā)Servlet重寫init()方法實(shí)例詳解的相關(guān)資料,需要的朋友可以參考下2017-04-04Tomcat網(wǎng)站發(fā)布配置方案詳細(xì)說明
Tomcat網(wǎng)站發(fā)布配置方案詳細(xì)說明,需要的朋友可以參考一下2013-03-03AJAX 自學(xué)練習(xí) 無刷新提交并修改數(shù)據(jù)庫數(shù)據(jù)并顯示
對(duì)應(yīng)在數(shù)據(jù)庫中表格 rocars表的msg_id,ccrn兩個(gè)字段?,F(xiàn)在要實(shí)現(xiàn)在界面上修改ccrn的值,ajax提交到response.jsp頁面,并調(diào)用RocarsEntiy.updateCcrn方法更新對(duì)應(yīng)的ccrn,最后無刷新顯示2009-09-09