用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文件。
spring 自动提示属性快捷键位 ctrl+shift+< 好
本文介绍如何在Eclipse中为XML文件启用自动补全功能,以Spring框架的配置文件为例,详细步骤包括设置XML Catalog及指定xsd文件路径。
1526

被折叠的 条评论
为什么被折叠?



