java learnging

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

          JSP中web.xml文件說明

          Posted on 2005-03-04 00:03 bigseal 閱讀(1054) 評論(0)  編輯  收藏
          web.xml文件的格式是在Servlet的規(guī)格說明書中定義的,所以這個文件格式可以用在任何與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



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


          網站導航:
           
          主站蜘蛛池模板: 光山县| 宁安市| 南漳县| 高碑店市| 甘孜县| 宿迁市| 临夏市| 门源| 保定市| 洛川县| 司法| 永昌县| 乡城县| 江源县| 银川市| 泸定县| 梁平县| 缙云县| 博湖县| 无棣县| 东城区| 揭阳市| 安庆市| 苍溪县| 藁城市| 怀宁县| 信宜市| 稷山县| 开封县| 石渠县| 剑河县| 延川县| 正定县| 青海省| 阳春市| 沁阳市| 诏安县| 奉贤区| 句容市| 吐鲁番市| 堆龙德庆县|