`
xiaosheng12345
  • 浏览: 12840 次
  • 性别: Icon_minigender_1
  • 来自: 济南
社区版块
存档分类
最新评论

一些刚琐碎的小技巧

阅读更多

 

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即可.

 

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics