网上看了下,全是用不了的方法,下面分享我的方法,环境是macOS10.13.1 eclipse
1.preferences 里查找xml,选择xml Catalog,点击右边User Specified Entries,点击add
2.左边选择第一个Catalog Entry,右边Location选择File System,找到你的struts-2.0.dtd ,key type 选Public ID
key -//Apache Software Foundation//DTD Struts Configuration 2.0//EN
address http://struts.apache.org/dtds/struts-2.0.dtd
3.选择src-new-other-XML-XML file
4.名字为struts,点击next
最终效果