让MyEclipse提示xml信息:
当我们在编写struts.xml时,发现MyEclipse并不会给出帮助提示,那是因为MyEclipse默认并不支持struts2的DTD约束,所以我们需要手工导入dtd以支持提示。
步骤:[window][preferences][MyEclipse][Files and Editors][XML][xml Catelog]
然后在右边点add添加:
location为dtd文件所在的位置(struts-2.3.dtd文件struts2-core-2.3.20.jar中可以得到),
KeyType选择URI,Key为struts-2.3.dtd文件中文档声明的内容(http://struts.apache.org/dtds/struts-2.3.dtd),
在struts.xml文件中也有此key值。
使用alt+/提示。