java learnging

          一塊探討JAVA的奧妙吧
          posts - 34, comments - 27, trackbacks - 0, articles - 22

          JSP中web.xml文件說明

          Posted on 2005-03-04 00:03 bigseal 閱讀(1055) 評論(0)  編輯  收藏
          web.xml文件的格式是在Servlet的規格說明書中定義的,所以這個文件格式可以用在任何與servlet相容(servlet-conforming )的Java servlet container。在Tomcat有兩個地方用到這個文件:$CATALINA_BASE/conf 文件夾和每個web應用程序。Tomcat每次配置一個應用程序(deploys an application )(在啟動或當應用程序載入的時候)時讀全局conf/web.xml,接著是應用程序中的WEB-INF/web.xml 。正如你所期望的conf/web.xml 文件中的設置會應用的所有的應用程序,而當前應用程序的WEB-INF/web.xml 僅僅應用到當前的應用程序。

          這個XML配置描述的根元素是
          web-app,這是頂層的元素,并且該文件元素必須按照下表的順序。這里沒有必需的元素,但最好應該有display-name來標識。
          Child elements of web-app

          Element

          Quantity allowed

          Meaning

          icon

          0 or 1

          A display file, for use in GUI administration tools

          display-name

          0 or 1

          Short name, for use in GUI admin tools

          description

          0 or 1

          Longer description

          distributable

          0 or 1

          Whether the web application can be load-balanced, i.e., distributed to multiple servers

          context-param

          0 or more

          Parameters to be made available to all servlets

          filter

          0 or more

          Provides a general-purpose servlet-based filtering mechanism

          filter-mapping

          0 or more

          Maps the invocation of a filter to either a servlet name or a URL pattern

          listener

          0 or more

          Context or session Listener classes

          servlet

          0 or more

          Short name, class name, and options for a servlet

          servlet-mapping

          0 or more

          Specifies any nondefault URL for a servlet

          session-config

          0 or 1

          Specifies session configuration (only session timeout in present version of specification)

          mime-mapping

          0 or more

          MIME types for files on server

          welcome-file- list

          0 or 1

          Alternate default page in directories

          error-page

          0 or more

          Alternate error page by HTTP error code

          taglib

          0 or more

          Tag library; see the section on the taglib element, later in this chapter

          resource-env-ref

          0 or more

          Reference to "administered objects," such as JMS queues

          resource-ref

          0 or more

          Reference to JNDI factory for objects such as SQL DataSources

          security- constraint

          0 or more

          Requires authentication (e.g., for a protected area of a web site)

          login-config

          0 or 1

          Specifies how the login mechanism is to work for a security-constraint

          security-role

          0 or more

          List name of security role, for use with security-constraint

          env-entry

          0 or more

          JNDI lookup of static objects

          ejb-ref

          0 or more

          Reference to EJBs used by servlets

          ejb-local-ref

          0 or more

          Reference to EJB local interfaces used by servlets



          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          主站蜘蛛池模板: 河南省| 万全县| 清新县| 射阳县| 普兰县| 阿勒泰市| 景洪市| 新晃| 外汇| 枣强县| 盘山县| 辉县市| 阜南县| 金沙县| 云浮市| 湛江市| 夏邑县| 汝州市| 深圳市| 临安市| 包头市| 治多县| 百色市| 鄂伦春自治旗| 栾川县| 灵石县| 自治县| 淮安市| 乌鲁木齐县| 隆安县| 新巴尔虎右旗| 兴安盟| 临朐县| 泾阳县| 图们市| 利辛县| 高州市| 佛山市| 东源县| 嘉禾县| 金川县|