手机
当前位置:查字典教程网 >编程开发 >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 常用标签的使用

处理jsp显示文字过长问题的解决方法

jsp ${param.id}用法

Linux和Windows中tomcat修改内存大小的方法

Jsp与servlet的区别

hibernate更新数据方法小结

jsp文件绝对路径的设置方法

JSP实现oracle数据库链库的常见方法

jsp用jdbc连接db2数据库的方法

在jsp中发送email

精品推荐
分类导航