struts2配置错误

```出现红色叉叉。
>The errors below were detected when validating the file "struts-2.3.dtd" via the file "struts.xml".  In most cases these errors can be detected by validating "struts-2.3.dtd" directly.  However it is possible that errors will only occur when struts-2.3.dtd is validated in the context of struts.xml.

>Description:the markup declarations contained or pointed to by the document type declara

解决了,原因是机器没上网,找不到指定的dtd文件!
可以这样做:在eclipse的菜单栏window中单击preference,依次找到XML-DTD Files,选择XML Catalog,选中右上方的User Specified Entries,单击add按钮,找到该dtd文件在本地的路径:
struts-2.1.8\src\core\src\main\resources\struts-2.3.dtd,Key Type 中选择uri,key中输入以下路径:http://struts.apache.org/dtds/struts-2.3.dtd,点击确定。回到struts.xml后在任意位置输入空格保存就行了

你可能感兴趣的:(struts2配置错误)