myeclipse配置Struts2.xml Referenced file contains errors (http://struts.apache.org/dtds/struts-2.0.dtd

本文介绍了解决Struts2.xml配置文件中DTD版本不匹配导致的问题,提供了两种有效的解决方案,包括修改DTD版本和创建新项目来更新Struts配置。

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

Struts2.xml 文件头出现这样错误

Referenced file contains errors (http://struts.apache.org/dtds/struts-2.0.dtd). For more information, right click on the message in the Problems View and select "Show Details..."

解决办法1: 

在myeclipse9.0,  [MyEclipse]-[Files-Editors]-[XML]-[XML Catalog]    查找到  “-//Apache Software Foundation//DTD Struts Configuration 2.1//EN ”  

 和

“-//Apache Software Foundation//DTD Struts Configuration 2.1.7//EN ” 

只需将struts.xml文件  “-//Apache Software Foundation//DTD Struts Configuration 2.0//EN ”   2.0修改为对应的 2.1或是2.1.7   ctrl+s即可

解决办法2: 

如果在myeclipse中无法找到 [Files-Editors]选项键,则新建一个web project项目

生成该 MyEclipse9.0系统版本 的 structs.xml文件。

根据新项目demo1中的structs.xml中的

-//Apache Software Foundation//DTD Struts Configuration 2.1//EN ”  

“-//Apache Software Foundation//DTD Struts Configuration 2.1.7//EN ” 

将出现错误的struts.xml文件  “-//Apache Software Foundation//DTD Struts Configuration 2.0//EN ”

 2.0修改为对应的 2.1或是2.1.7   ctrl+s即可

生成对应的structs.xml步骤如下:

在新建的项目demo1->[MyEclipse]->[Project Facets]->[install Apache Structs  (2.x)facet]->[finish]


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值