1、找到配置文件頭標題中的url。這里以Struts2驗證的配置文件為例:
<!DOCTYPE validators PUBLIC
"-//Apache Struts//XWork Validator 1.0.3//EN"
"http://struts.apache.org/dtds/xwork-validator-1.0.3.dtd">
1、拷貝url:http://struts.apache.org/dtds/xwork-validator-1.0.3.dtd
2、在myeclipse工具中:Window-->Preferences-->myEclipse Files and Editors-->XML-->XML Files-->XML CataLog
3、選User Specified Ectries項 點(Add)添加:
4、選Catalog Entry,
Location: 選系統文件(File System)找到源碼中和下面的 Key 對應既可。
Key type:選 URI
Key: http://struts.apache.org/dtds/xwork-validator-1.0.3.dtd
(進入Preferences項后直接搜索XMl快速定位)