网站公告列表

  没有公告

加入收藏
设为首页
联系站长
您现在的位置: 网络学院 >> 程序设计 >> Java编程 >> 文章正文
  web.xml语句顺序问题            【字体:
web.xml语句顺序问题
作者:佚名    文章来源:不详    点击数:    更新时间:2007-9-2    
正在装载数据……

报错信息

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:
<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.
 


本文来源:http://blog.csdn.net/DL88250/archive/2007/08/03/1725457.aspx
站内文章搜索 高级搜索
文章录入:admin    责任编辑:admin 
  • 上一篇文章:

  • 下一篇文章:
  • 发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
    最新热点 最新推荐 相关文章
     用java实现web服务器
     用java快速开发linux gu…
     正则表达式分解siemens交…
     [portal参考手册]目录
     jsp中调用oracle存储过程…
  • weblogic 9.1的domain配置my…

  • 保留weblogic 中jsp编译后生…

  • Cookie又见Cookie-使用Html…

  • JavaWeb中的Session、Sessio…

  • MVP——Model-Viewer-Presen…

  • 《程序员》9期上市,Enterpr…

  • (转)使用面向对象的技术创…

  • VB.NET类的总结(一)

  • VB.NET模块的总结(二)

  • VB.NET模块的总结(一)精简版

  •   网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)
    网络学院©2007 www.23book.net
    为您提供web编程,vb编程,vc编程,服务器架设管理,数据库设计等方面的知识 站长:David