在Eclipse中添加struts.xml为什么会出现错误?

No1:你struts2的jar包导入齐全没有 ,在仓库里面找/在libraries找
No2:好像是struts2上面的配置有问题,应该是
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
    "-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
    "http://struts.apache.org/dtds/struts-2.3.dtd">

dtd版本要一致  之前我用的是struts2的jar包 是2.1.7的版本 现在我换了另一个版本的jar包2.3 但是struts.xml文件是copy之前的

所以会报一个错

先把我的struts.xml里的dtd改为和核心包里struts.defalut.xml默认的dtd规范

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

翻译出来是:

引用的文件包含错误(http://struts.apache.org/dtds/struts-2.3.dtd)。要了解更多信息,在Problems视图中右键单击消息并选择“Show”

细节……”

猜你喜欢

转载自blog.csdn.net/qqqnzhky/article/details/82666960
今日推荐