`

添加xml文件自动提示方法,以spring配置文件为例-备忘录

阅读更多
用eclipse,在导入相应的包后(有人说不导包也有提示,因为默认的eclipse导入了jdk的包),eclipse会有代码提示功能。
那么XML文件能不能也这样呢?其实也是可以的,只不过导包的地方不一样。下面以spring为例(虽然Myeclipse6.5中已经集成了,这里只是示范说明)。

进入:window -> Preference... -> MyEclipse -> Editors -> XML ->XML Catalog

选择:选中“User Specified Entries”,点击“Add...”按钮

填入:

URI: 请选择本地文件系统上SPRING_HOME\dist\resources\spring-beans-2.0.xsd 文件
Key Type: 选择Schema Location
Key: http://www.springframework.org/schema/beans/spring-beans-2.0.xsd

点击确定

将spring配置文件关闭再重新打开即可。可以使用MyEclipse XML Editor打开这些xml文件。
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics