最新更新 sitemap 网站制作设计本站搜索
网页设计
国外网站 韩国网站 个人主页 手提袋设计 CSS 网页特效 平面设计 网站设计 Flash CMS技巧 服装网站 php教程 photoshop 画册 服务器选用 数据库 Office
虚拟主机 域名注册 云主机 网页设计 客服QQ:8208442
当前位置:首页 > 编程开发 > jsp教程

jsp编程:JSP中errorPage设置方法

日期:10-15    来源:中国设计秀    作者:cnwebshow.com

1.设置errorPage:errorPage.jspFhG中国设计秀

<%@page isErrorPage="true"%>FhG中国设计秀
<html>FhG中国设计秀
    <head>FhG中国设计秀
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">FhG中国设计秀
        <title>JSP Page</title>FhG中国设计秀
    </head>FhG中国设计秀
    <body>FhG中国设计秀
         Error~!FhG中国设计秀
         <%=exception.getMessage()%>FhG中国设计秀
    </body>FhG中国设计秀
</html>FhG中国设计秀

2.应用FhG中国设计秀

<%@page info="Bad page"%>FhG中国设计秀
<%@page errorPage="errorPage.jsp" %>   //出错后转到FhG中国设计秀
<html>FhG中国设计秀
    <head>FhG中国设计秀
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">FhG中国设计秀
        <title>JSP Page</title>FhG中国设计秀
    </head>FhG中国设计秀
    <body>FhG中国设计秀
         <%FhG中国设计秀
               boolean tf = true;FhG中国设计秀
               if(tf){FhG中国设计秀
                    String info = getServletInfo();FhG中国设计秀
                    throw new Exception("Exception in:" + info);FhG中国设计秀
               }FhG中国设计秀
         %>FhG中国设计秀
    </body>FhG中国设计秀
</html>FhG中国设计秀

本文引用地址:/bc/article_46566.html
网站地图 | 关于我们 | 联系我们 | 网站建设 | 广告服务 | 版权声明 | 免责声明