转:referenced file contains errors (http://struts.apache.org/dtds/struts-2.5.dtd)

原文地址:https://zhidao.baidu.com/question/54687355.html

解决方法(两种):

1. 这个可能是你的DTD文件找不到,或者解析有错,才发生的错误.你可以在地址栏里输入http://struts.apache.org/dtds/struts-2.5 .dtd 这个看能查看不,
如果不能,应该是网络的问题或XML解析的问题,解决的方法就是你把DTD文件(struts2-core-2.5.10.1.jar里面)拷贝到你的CLASSPATH目录下,把http://struts.apache.org/dtds/struts-2.5 .dtd 这个路径换成"/WEB-INF/struts-2.5 .dtd "这样再试一下

2. 从struts2-core-2.x.x.jar中取出struts-2.5.dtd,打开[Window]-[Properties],打开对话框.在左边的树形列表中选择[MyEclipse]-[Files-Editors]-[XML]-[XML Catalog],此时右边显示相应的内容.在右边[XML Catalog Entries]下方有一个[Add]按钮,单击它,在弹出的对话框中输入:
Location:UseStruts2/src/struts 2.5.dtd(这个选择你刚取出来的 struts-2.5.dtd文件)
Key Type:Public ID
Key:-//Apache Software Foundation//DTD Struts Configuration 2.5//EN
选择[OK]即可添加.

posted @ 2017-03-31 11:15  技术宅星云  阅读(1536)  评论(0编辑  收藏  举报