jsp中error page设置方法_JSP教程-查字典教程网
jsp中error page设置方法
jsp中error page设置方法
发布时间:2015-06-05 来源:查字典编辑
摘要:1.设置errorPage:errorPage.jspJSPPageError~!2.应用//出错后转到JSPPage

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>

相关阅读
推荐文章
猜你喜欢
附近的人在看
推荐阅读
拓展阅读
  • 大家都在看
  • 小编推荐
  • 猜你喜欢
  • 最新JSP教程学习
    热门JSP教程学习
    编程开发子分类