手机
当前位置:查字典教程网 >编程开发 >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页面中响应速度提高的7种方法分享

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

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

jsp action中保存和修改的关系

什么是jsp设计模式

jsp中使用javabean实例介绍

jsp利用application统计在线人数的方法

JSP errorPage设置方法

jsp中使用javabean实例

frameset布局时frame中src路径的页面没有加载的解决方法

精品推荐
分类导航