Eclipse增加ssh xml的自动提示功能

来源:互联网 发布:nginx使用场景 编辑:程序博客网 时间:2024/05/17 09:03

增加Spring的提示:

进入:window -> Preference... -> MyEclipse -> Editors -> XML ->XML Catalog
选择:选中“User Specified En
tries”,点击“Add...”按钮
填入:
URI: 请选择本地文件系统上SPRING_HOME\dist\resources\spring-beans-2.0.xsd 文件
Key Type: 选择Schema Lo
cation
Key: http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
点击确定
将spring配置文件关闭再重新打开即可。可以使用MyEclipse XML Editor打开这些xml文件。

  • spring-beans-2.0.xsd.rar (7.5 KB)

增加Strust的提示:

1,打开window-preferences-myeclipse enterprise workbench-files and editors-xml-xml catalog,
点 add..,出现一对话框,location栏选file system,
找到struts-2.0.14-all\struts-2.0.14\src\core\src\main\resources目录下的struts-2.0.dtd文件,
打开,然后key type 选择uri,
下面key值填 http://struts.apache.org/dtds/struts-2.0.dtd,点击OK,
这样再次打开struts.xml时应该就有提示了。
2,当你输入元素后,如果没有属性提示,比如输入<action name="" ></action>,不能再继续提示action中的属性的话,需要做如下修改:
打开window-preferences-general-keys,在右边找到content Assist这一栏,如果这一栏中binding下面有值,点击remove binding,然后在下面的binding栏,选择另一个快捷键,比如‘alt+,’,点击OK。
重新打开struts.xml文件,需要属性提示时,按所设置的快捷键,就会出现属性提示。
-----------------------------------------------------------------------------------------------------------------------------------------------------
按照网上介绍的这样做,还是没用。
最后发现原来我的源文件路径里有中文,改成英文就OK了!

3,

1: 点击window – preferences – 搜索 catalog – add

2:选择key type为URI

3:key: http://struts.apache.org/dtds/struts-2.0.dtd

该文件是 struts.xml文件中的,复制即可

4:location: 对应的dtd文件,位于struts-core包中,解压开,指定相应位置,

如:D:\Struts2.1.6\soft\struts- 2.1.6 \lib\struts2-core-2.1.6\struts-2.0.dtd



例如:
你写的struts.xml的头信息是:

Xml代码
  1. <?xml?version="1.0"?encoding="UTF-8"??>
  2.  <!DOCTYPE?struts?PUBLIC
  3.   "-//Apache?Software?Foundation//DTD?Struts?Configuration?2.1//EN"
  4.   "http://struts.apache.org/dtds/struts-2.1.dtd">


如果我们配置的是:http://struts.apache.org/dtds/struts-2.1.dtd
那么我们就去找找到这个文件,按照上面的步骤做就可以了,指定好文件后记得要关闭一下这个struts.xml文件,在次打开就可以了。

增加Hibernate的提示:

 

1、打开项目中任意一个 *.hbm.xml 文件,看一下文件头
       找到
http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd(视 hibernate 版本不同有所不同,作者使用的是 hibernate3.6.7)。
 2、将项目中用到的 hibernate3.jar 解压缩,找到解压缩后的 org 文件下的 hibernate 文件下的 hibernate-mapping-3.0.dtd 文件。
 3、eclipse -> Window -> Preferences -> Web and XML -> XML Catalog,选择 XML Catalog Entries 的 Add... 按钮,在弹出的 Add XML Catalog Entry 对话框里,Location  里选择第二步里得到的 hibernate-mapping-3.0.dtd,Key Type 选择 URI,Key 里输入第一步里得到的
http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd。OK。
          再打开 eclipse 中的 *.hbm.xml 文件,编辑时就可以像 myeclipse 中那样拥有自动提示功能了。