我按照网上找到的指引,在MyEclipse中导入了struts-2.0.dtd:
“从struts2-core-2.x.x.jar中取出struts-2.0.dtd,打开[Window]-[Properties],打开对话框.在左边的树形列表中选择[MyEclipse]-[Files-Editors]-[XML]-[XML Catalog],此时右边显示相应的内容.在右边[XML Catalog Entries]下方有一个[Add]按钮,单击它,在弹出的对话框中输入:
Location:UseStruts2/src/struts 2.0.dtd(这个选择你刚取出来的 struts-2.0.dtd文件)
Key Type:URI
Key:-//Apache Software Foundation//DTD Struts Configuration 2.0//EN”
struts.xml文件中:
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
======================================================
MyEclipse 编辑xml格式文件,为什么不能自动补全?
比如我的struts2的配置文件struts.xml
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
< struts >
<此处不能自动补全struts下的标签???????????
方法:首先找到struts-2.0.dtd文件,在struts2-core-2.xx.jar包下,解压以后就能找到。
然后将struts-2.0.dtd文件拷贝到例如:
E:\j2ee\MyEclipse5.5\myeclipse\eclipse\plugins\com.genuitec.eclipse.j2eedt.core_5.5.0\catalog-dtd 目录下。
接下来重启你的MyEclipse就搞定了。。