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的規(guī)格說明書中定義的,所以這個文件格式可以用在任何與servlet相容(servlet-conforming )的Java servlet container。在Tomcat有兩個地方用到這個文件:$CATALINA_BASE/conf 文件夾和每個web應(yīng)用程序。Tomcat每次配置一個應(yīng)用程序(deploys an application )(在啟動或當(dāng)應(yīng)用程序載入的時候)時讀全局conf/web.xml,接著是應(yīng)用程序中的WEB-INF/web.xml 。正如你所期望的conf/web.xml 文件中的設(shè)置會應(yīng)用的所有的應(yīng)用程序,而當(dāng)前應(yīng)用程序的WEB-INF/web.xml 僅僅應(yīng)用到當(dāng)前的應(yīng)用程序。

          這個XML配置描述的根元素是
          web-app,這是頂層的元素,并且該文件元素必須按照下表的順序。這里沒有必需的元素,但最好應(yīng)該有display-name來標(biāo)識。
          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ā)表評論。


          網(wǎng)站導(dǎo)航:
           
          主站蜘蛛池模板: 塔河县| 碌曲县| 太原市| 盘山县| 攀枝花市| 平山县| 从化市| 章丘市| 和平县| 万安县| 磴口县| 高淳县| 若羌县| 祥云县| 阿城市| 平利县| 武城县| 夏河县| 贵溪市| 石门县| 庆阳市| 佛教| 玉山县| 东阿县| 略阳县| 海原县| 抚远县| 镇平县| 常德市| 普格县| 康定县| 洛隆县| 永德县| 古蔺县| 田东县| 霞浦县| 广宗县| 吴堡县| 平和县| 库尔勒市| 香港|