Eclipse中建立struts2的配置文件struts.xml

Eclipse中建立struts2的配置文件struts.xml 的步骤:
1、解压最新的struts2包文件,我用的是:struts-2.5.16-all.zip(上Struts的官网下载),然后找到struts-2.5.dtd所在路径并复制。(在struts2文件夹下的lib目录,找到struts2-core文件并解压,打开解压的目录下即可找到 struts2.5.dtd 。这里location就选中该文件。)
2、在Eclipse中,选择windows–>Preferences–>在XML文件夹中找到XML Catalog,点击Add.
3、
Eclipse中建立struts2的配置文件struts.xml
Location:D:\DOWNLOAD\java\struts\lib\struts-2.5.16\dtd\struts-2.5.dtd—————>dtd文件所在位置
Key type:public ID
Key:-//Apache Software Foundation//DTD Struts Configuration 2.5//EN————–>可以从struts-2.5.dtd文件中查找
Alternative web address:http://struts.apache.org/dtds/struts-2.5.dtd————–>可以从struts-2.5.dtd文件中查找
都在dtd文件的注释中
Eclipse中建立struts2的配置文件struts.xml
点击OK!

为Eclipse添加好dtd的配置之后,我们就可以使用工具在src目录中创建XML文件了:
步骤:New->Other->XML->XML File->Next->填写文件名->Next->CreateXML file from a DTD file->Next->Select XML Catalog entry->选择对应的dtd文件实体配置->Next->Finish。
感觉很麻烦,每次新建struts文件都要重复这个步骤,不知道怎么默认设置struts文件,每次都是用这个配置。