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" %> //出错后转到
<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" %> //出错后转到
<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>
相关文章
JSP指令元素(page指令/include指令/taglib指令)复习整理
JSP指令元素部分(page指令、include指令、taglib指令),今天抽时间复习了一下,并对心得进行了整理,下面与大家分享下,希望对大家学习jsp有所帮助2013-07-07
JSP页面IE无法打开Internet 站点…… 已终止操作 的解决方法
今天机缘巧合之下遇到了个人认为比较经典的“IE无法打开Internet 站点…… 已终止操作”的问题。2013-05-05


最新评论