栏目导航
热点推荐
- 测试你对技术的掌握度:JSP程序
- Eclipse 3.0 上配置JSP开发环境
- Jsp基础知识总结
- 整合Tomcat4.1和IIS5 直到能够正
- JSP服务器的安装与配置(带数据库
- 在JSP环境中如何配置和使用fcked
- JSP中表单数据存储的通用方法
- 在JSP环境中如何来配置和使用fck
- Oracle数据库和JSP连接要注意的
阅览排行
JSP中errorPage设置方法
www.jz123.cn 2009-10-26 来源: 中国建站 责任编辑(袁袁) 我要投递新闻
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中的offsetparent 下一篇:JSP用bean获取各种参数