博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
yiluo-----web.xml语句顺序问题
阅读量:2353 次
发布时间:2019-05-10

本文共 2079 字,大约阅读时间需要 6 分钟。

文章来源:http://blog.csdn.net/yiluoak_47/article/details/12070253

报错信息

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:

======================================

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.
你可能感兴趣的文章
php中抽象类和接口的概念与区别
查看>>
php抽象类和接口
查看>>
如何在linux CentOS 上安装chrome 谷歌浏览器
查看>>
laravel5 怎么实现事务
查看>>
GitLab安装说明
查看>>
Git查看、删除、重命名远程分支和tag
查看>>
PHP类中的抽象类,抽象方法,abstract
查看>>
PHP接口类interface的正确使用方法
查看>>
Sencha Touch之Hello World
查看>>
Tab Layout 之单个Activity实现
查看>>
Tab Layout 之多个Activity实现
查看>>
FrameLayout之我见
查看>>
个人解读Activity之一
查看>>
实现自定义布局的Notification
查看>>
AlarmManager的学习与实现
查看>>
解读Content Provider之一
查看>>
解读Content Provider之二
查看>>
自定义UI实例
查看>>
推荐一个不错的自定义UI
查看>>
fedora16 设置 gedit软件的默认编码
查看>>