web.xml The content of element type "web-app" must match "

本文解决了一个关于web.xml文件中元素顺序的问题,该问题导致了使用不同IDE的开发者遇到兼容性错误。文章详细解释了2.3.dtd版本下web-app元素内容的正确顺序,并提供了正确的DTD声明示例。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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*)".

从svn上下下来的代码,别人用的是myecplise6.5,我的是ecplise3.4 他们的机器上么有问题,我的报这个错误,dtd格式是这个2.3.dtd

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>

这是因为web.xml的标签在2.3.dtd中必须按照上面的顺序来,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






评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值