一些刚琐碎的小技巧

2 myeclipse 中 为xml或其他类似文档添加dtd提示

比如Struts2 有个struts2.0.dtd 如果要写struts.xml,需要添加dtd文件里提到的头文件

<!DOCTYPE struts PUBLIC 
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" 
"http://struts.apache.org/dtds/struts-2.0.dtd"> 
 
 <!DOCTYPE struts PUBLIC 
	"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
	"http://struts.apache.org/dtds/struts-2.0.dtd">

这玩意加上后,如果不设置一下,按< 后,是不会提示元素名字的. 下面公布方法

以struts为例,先解压struts的jar包到某位置, 复制上文中 第二行引号里的内容,具体可以打开解压后对应struts.xml里面的头文件.

myeclipse下,windos--->preferences--然后左边顶上,输入xml,然后回车,找到xml catalog,在其右边点击add 添加按钮.新框中,location框的右边,点击,找filedSystem,找到要添加的dtd文件,keyType默认public ID即可,然后key那里,把头文件的第二行

-//Apache Software Foundation//DTD Struts Configuration 2.0//EN 
 
-//Apache Software Foundation//DTD Struts Configuration 2.0//EN

粘贴上.一路ok即可.

猜你喜欢

转载自xiaosheng12345.iteye.com/blog/1965245