1. 程式人生 > >web.xml 中標籤元素配置順序

web.xml 中標籤元素配置順序

Element : web-app
The web-app element is the root of the deployment 
 descriptor for a web application. Note that the sub-elements 
 of this element can be in the arbitrary order. Because of 
 that, the multiplicity of the elements of distributable, session-
 config, welcome-file-list, jsp-config, login-config, and locale-
 encoding-mapping-list was changed from "?" to "*" in this 
 schema. However, the deployment descriptor instance file 
 must not contain multiple elements of session-config, jsp-
 config, and login-config. When there are multiple elements 
 of welcome-file-list or locale-encoding-mapping-list, the 
 container must concatenate the element contents. The 
 multiple occurence of the element distributable is redundant 
 and the container treats that case exactly in the same way 
 when there is only one distributable.

Content Model : (((description*, display-name*, icon*)) | 
 distributable | context-param | filter | filter-mapping | listener 
 | servlet | servlet-mapping | session-config | mime-mapping | 
 welcome-file-list | error-page | jsp-config | security-
 constraint | login-config | security-role | ((env-entry*, ejb-ref*, 
 ejb-local-ref*, ((service-ref*)), resource-ref*, resource-env-
 ref*, message-destination-ref*, persistence-context-ref*, 
 persistence-unit-ref*, post-construct*, pre-destroy*)) | 
 message-destination | locale-encoding-mapping-list)*

譯文:

元素:web
web-app元素是部署的根元素
web應用程式的描述符。注意,子元素
這個元素的順序可以是任意的。因為
這是可分配元素的多樣性,session-
配置、歡迎檔案列表、jsp配置、登入配置和locale-
在這裡,編碼器對映表從“?”改為“*”
模式。但是,部署描述符例項檔案
不能包含會話配置、jsp- ?的多個元素
配置和login-config。當有多個元素時
的方法
容器必須連線元素內容。的
可分佈元素的多次出現是多餘的
容器以完全相同的方式處理這種情況
當只有一個可分佈時。
內容模型:((描述*,顯示名稱*,圖示*))|
可分佈的|上下文引數|過濾器|過濾器對映|監聽器
| servlet | servlet對映|會話配置| mime對映|
歡迎檔案列表|錯誤頁| jsp配置|安全-
約束|登入配置|安全形色| ((env-entry*, ejb-ref*,
ejb-local-ref *((service-ref *)),資源引用*,resource-env -
* message - destination - ref *,persistence-context-ref *,
persistence-unit-ref *,post-construct *,pre-destroy | *))
訊息目的地| locale-encoding-mapping-list)*