zoukankan      html  css  js  c++  java
  • web.xml配置详解之欢迎页面和错误页面

    <!-- 应用的欢迎页面  采用list的方式罗列欢迎页面,

    系统会从第一个找到最后一个,找到了文件就不继续往下找了。优先显示前边的。

    -->

        <welcome-file-list>

           <welcome-file>index.jsp</welcome-file>

           <welcome-file>login.jsp</welcome-file>

           <welcome-file>index.html</welcome-file>

           <welcome-file>index.htm</welcome-file>

           <welcome-file>default.html</welcome-file>

           <welcome-file>default.htm</welcome-file>

           <welcome-file>default.jsp</welcome-file>

        </welcome-file-list>

        <!-- 通过上边welcome-file-lis的配置:我们的应用的欢迎界面或者叫默认界面就是index.jsp,如果index.jsp没找到的话

        就接着往下找:login.jsp,index.html.... -->

       

        <!-- 配置错误页面

           error-page标签用来配置档应用出现指定错误码的错误时候,有哪个页面来处理这个错误,而不是给用户

               显示系统的错误信息。子标签:

           error-code:系统错误码

           location:应用系统中的处理错误页面。

        -->

        <error-page>

           <error-code>404</error-code>

           <location>/common/404.html</location>

           <!-- 表示当系统发生404就是不存在请求地址的错误的时候,页面跳转到404.html页面。 -->

        </error-page>

        <error-page>

           <error-code>500</error-code>

           <location>/common/error.jsp</location>

           <!-- 表示当系统发生500也就是操作异常错误的时候,页面跳转到error.jsp页面。 -->

        </error-page>

        <error-page>

           <exception-type>java.lang.NullPointerException</exception-type>

           <location>/common/error.jsp</location>

           <!-- 表示当系统发生空指针异常错误的时候,页面跳转到error.html页面。 -->

        </error-page>

        <!-- 通过上边对error-apge的配置:当我们系统的系统发生404错误的时候,页面调准到404.html,

        当页面发生服务器错我或者空指针错误的时候,页面跳转到error.html -->

    </web-app>

     此文转载于:http://angrycoder.iteye.com/blog/919375

  • 相关阅读:
    [基础]RHEL6下LINUX服务器批量部署
    delphi 连接 c++ builder 生成obj文件
    Delphi基本图像处理代码
    Delphi 版本号(D1到XE6),发现一个delphi.wikia.com网站
    Delphi常用排序
    Delphi中用Webbrowser加载百度地图滚轮失效(ApplicationEvents里使用IsChild提前判断是哪个控件的消息)
    判断连个单链表是否交叉,并找到交叉点
    窗体自适应屏幕分辨率
    Zlib压缩算法在Java与Delphi间交互实现(压缩XML交互)
    开机自动启动程序的几种方法
  • 原文地址:https://www.cnblogs.com/liuyq/p/3664195.html
Copyright © 2011-2022 走看看