struts2配置错误

<?xml version="1.0" encoding="UTF-8"?>```出现红色叉叉。
>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后在任意位置输入空格保存就行了
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 本文包括: 1、Struts 2 概述2、Struts 2 快速入门3、Struts 2 的执行流程4、配置 st...
    廖少少阅读 2,998评论 3 13
  • 概述 Struts就是基于mvc模式的框架!(struts其实也是servlet封装,提高开发效率!) Strut...
    奋斗的老王阅读 2,993评论 0 51
  • NAME dnsmasq - A lightweight DHCP and caching DNS server....
    ximitc阅读 2,936评论 0 0
  • 爸爸是72年出生的, 今年43岁。 他很高, 中等身材, 小时候没觉得他帅, 但现在越来越觉得爸爸老帅了。 小时候...
    我要打劫机器猫阅读 254评论 0 0
  • 2016年5月参加好报写作班,坚持到10月末,然后休息了两个月,2017年1月又重新参加,用简书写了84+114/...
    石头wdh阅读 420评论 3 3