首页 应用 游戏 资讯 攻略

JSP中errorPage设置方法

时间:2011-07-05 关注公众号 来源:网络

  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>

阅读全文
扫码关注“ 多特资源库
更多更全的软件资源下载
文章内容来源于网络,不代表本站立场,若侵犯到您的权益,可联系我们删除。(本站为非盈利性质网站)
玩家热搜

相关攻略

正在加载中
版权
版权说明

文章内容来源于网络,不代表本站立场,若侵犯到您的权益,可联系我们删除。(本站为非盈利性质网站)

电话:13918309914

QQ:1967830372

邮箱:rjfawu@163.com

toast