首页 | 源码下载 | 网站模板 | 网页特效 | 广告代码 | 网页素材 | 字体下载 | 书库 | 站长工具
会员投稿 投稿指南 RSS订阅
当前位置:主页>网络编程>jsp教程>资讯:JSP中errorPage设置方法

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获取各种参数

评论总数:1 [ 查看全部 ] 网友评论


关于我们隐私版权广告服务友情链接联系我们网站地图