Tomcat中web.xml语句顺序问题
来源:互联网 发布:52单片机最小系统焊接 编辑:程序博客网 时间:2024/05/21 10:01
报错信息
The content of element type "web-app" must match "(icon?,display-name?,description?,distributable?,context-param*,filter*,filter-mapping*,listener*,servlet*,servlet-mapping*,session-config?,mime-mapping*,welcome-file-list?,error-page*,taglib*,resource-env-ref*,resource-ref*,security-constraint*,login-config?,security-role*,env-entry*,ejb-ref*,ejb-local-ref*)".
原因和DTD 的格式要求有关,原文摘录如下:
==================================================
So for the 2.3 version of the DTD, you have to put the tags in the correct order. You have:
But the DTD says it must be:
<web-app> <servlet></servlet> <servlet-mapping></servlet-mapping> <servlet></servlet> <servlet-mapping></servlet-mapping> <servlet></servlet> <servlet-mapping></servlet-mapping> <!-- ... --> <listener></listener></web-app>
But the DTD says it must be:
<web-app> <listener></listener> <servlet></servlet> <servlet></servlet> <servlet></servlet> <!-- ... --> <servlet-mapping></servlet-mapping> <servlet-mapping></servlet-mapping> <servlet-mapping></servlet-mapping> <!-- ... --></web-app>
======================================
The error message tells you the order they must be in:
content of element type "web-app" must match "(icon?,display-name?,description?,distributable?,context-param*,filter*,filter-mapping*,listener*,servlet*,servlet-mapping*,session-config?,mime-mapping*,welcome-file-list?,error-page*,taglib*,resource-env-ref*,resource-ref*,security-constraint*,login-config?,security-role*,env-entry*,ejb-ref*,ejb-local-ref*)"
Means the order is:
icon (0 or 1 times)display-name (0 or 1 times)description (0 or 1 times)distributable (0 or 1 times)context-param (0 or more times)filter (0 or more times)filter-mapping (0 or more times)listener (0 or more times)servlet (0 or more times)servlet-mapping (0 or more times)session-config (0 or 1 times)mime-mapping (0 or more times)welcome-file-list (0 or 1 times)error-page (0 or more times)taglib (0 or more times)resource-env-ref (0 or more times)resource-ref (0 or more times)security-constraint (0 or more times)login-config (0 or 1 times)security-role (0 or more times)env-entry (0 or more times)ejb-ref (0 or more times)ejb-local-ref (0 or more times)
==============================
i also want to know that
are tags supposed to be in some order in version 2.4, or i can have them in any order ?
Answer:
The 2.4 spec can be in any order.
- Tomcat中web.xml语句顺序问题
- Tomcat中web.xml语句顺序
- web.xml语句顺序问题
- web.xml语句顺序问题
- yiluo-----web.xml语句顺序问题
- tomcat web.xml加载顺序
- tomcat web.xml加载顺序
- tomcat web.xml加载顺序
- tomcat web.xml加载顺序
- tomcat中web.xml
- web.xml中servlet, bean, filter, listenr 加载顺序问题
- SpringMVC项目中web.xml中的节点加载顺序问题
- Tomcat-----web.xml的加载顺序
- Tomcat web.xml配置问题
- 关于tomcat中web.xml中的多个filter的运行顺序
- 读Tomcat源码确定加载web.xml中节点元素的顺序
- Tomcat启动时加载数据到缓存[web.xml中listener加载顺序]
- WEB.XML文件加载顺序问题研究
- 成为编程高手的八大奥秘 (转载)
- 利用ArcGIS Engine、VS .NET和Windows控件开发GIS应用
- 用 Win2003 架设邮件服务器
- PAL和NTSC
- win2003server邮件服务器架设
- Tomcat中web.xml语句顺序问题
- 关于死的话题,该如何对4岁多的孩子解释
- 如何架设小企业邮件服务器
- 刚来
- 用asp.net获取服务器和客服端有关信息
- XmlHtml.js (不会使用这个啊,)怎么办啊,有谁会使用吗?帮个忙啊?
- asp.net控件开发基础(3)
- 针对ASP类网站的Win 2003硬盘安全设置
- asp.net控件开发基础(4)