手机
当前位置:查字典教程网 >编程开发 >JSP教程 >jsp中error page设置方法
jsp中error page设置方法
摘要: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中error page设置方法】相关文章:

jsp中使用javabean实例

jsp中定义和使用方法示例介绍

jsp中freemarker 数字格式化

在jsp页面中响应速度提高的7种方法分享

Jsp中response对象的所有属性详细介绍

jsp下页面跳转的几种方法小结

jsp内置对象及方法详细介绍

Jsp中解决session过期跳转到登陆页面并跳出iframe框架的方法

jsp页面中插入css样式的三种方法总结

消除js以及jsp文件中的警告方法

上一篇: JSP与Cookie
精品推荐
分类导航