Eclipse中Java、XML文件、注释等各种自动提示功能配置
2014-08-07 08:32
316 查看
一、 xml文件添加自动提示功能
xml文件的自动提示功能需要导入不同的相关xsd文件,下面以常用的beans及context来说明配置方法。
1.xml文件添加beans自动提示功能
Eclipse窗口选择
window – preferences – myeclipse – xml – xml catalog
选择User Specified Entries并点击add
Location:添加spring-beans-2.5.xsd文件所在路径
Key type:选择Schema location
Key:自动填充
确认后即有提示如图,
2. xml文件添加context自动提示功能
同理,
导入相关xsd文件
要想使用的话,还要在xml文件中加上下面几句话才行
如图,
二、java文件及注释自动提示
成功啦!一般的Java文件提示如图,
注释提示功能如图,
不过使用annotation注释功能也是要在xml配置文件中补充几句话的
用annotation必须加上四句话如下,
如图,
要使用不同的注释的前提也是已经导入过相应的jar包了,不同的注释要导入的包不同,举例来说,
@RequestMapping 对应spring-web-3.2.8.RELEASE.jar
@Aspect 对应aspectjweaver-1.6.9.jar和aspectjrt-1.6.9.jar
具体的版本好像是无所谓的,我选的时候就是找了本地库中版本最新的,似乎版本不一致也没有什么太大影响的
xml文件的自动提示功能需要导入不同的相关xsd文件,下面以常用的beans及context来说明配置方法。
1.xml文件添加beans自动提示功能
Eclipse窗口选择
window – preferences – myeclipse – xml – xml catalog
选择User Specified Entries并点击add
Location:添加spring-beans-2.5.xsd文件所在路径
Key type:选择Schema location
Key:自动填充
确认后即有提示如图,
2. xml文件添加context自动提示功能
同理,
导入相关xsd文件
要想使用的话,还要在xml文件中加上下面几句话才行
<pre name="code" class="javascript">xmlns:context="http://www.springframework.org/schema/context" http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd <context:annotation-config /> <span style="font-size:18px;"><strong><span style="color:#ff00;"></textarea></span></strong></span>
如图,
二、java文件及注释自动提示
成功啦!一般的Java文件提示如图,
注释提示功能如图,
不过使用annotation注释功能也是要在xml配置文件中补充几句话的
用annotation必须加上四句话如下,
<pre name="code" class="html">xmlns:context="http://www.springframework.org/schema/context" http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd <context:annotation-config />
如图,
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xmlns:aop="http://www.springframework.org/schema/aop" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd"> <context:annotation-config /> <context:component-scan base-package="com.bjsxt"/> <aop:aspectj-autoproxy />
要使用不同的注释的前提也是已经导入过相应的jar包了,不同的注释要导入的包不同,举例来说,
@RequestMapping 对应spring-web-3.2.8.RELEASE.jar
@Aspect 对应aspectjweaver-1.6.9.jar和aspectjrt-1.6.9.jar
具体的版本好像是无所谓的,我选的时候就是找了本地库中版本最新的,似乎版本不一致也没有什么太大影响的
相关文章推荐
- eclipse中设置java、xml文件的字体大小以及代码自动提示功能
- 如何配置eclipse的JAVA和XML代码自动提示功能
- XML文件添加自动提示功能以及java文件中注释自动提示
- Eclipse配置详解(包括智能提示设置、智能提示插件修改,修改空格自动上屏、JDK配置、各种快捷键列表……)
- eclipse(xmlbuddy插件)为xml文件自动提示(同MyEclipse编辑XML的提示功能),以spring配置文件为例
- Eclipse Android java与xml代码自动提示功能
- Eclipse 自动提示功能配置
- Eclipse 自动提示功能配置
- 为 eclipse 的 hibernate 配置文件(*.hbm.xml)加上自动提示功能
- eclipse为SSH框架.xml文件添加自动提示功能
- 比较全面的Eclipse配置详解(包括智能提示设置、智能提示插件修改,修改空格自动上屏、JDK配置、各种快捷键列表……)
- 比较全面的Eclipse配置详解(包括智能提示设置、智能提示插件修改,修改空格自动上屏、JDK配置、各种快捷键列表……)
- Eclipse 自动提示功能配置
- java_Eclipse自动生成作者、日期注释等功能设置_导入 xml方式
- 为 eclipse 的 hibernate 配置文件(*.hbm.xml)加上自动提示功能
- 为 eclipse 的 hibernate 配置文件(*.hbm.xml)加上自动提示功能
- Eclipse 自动提示功能配置
- 为 eclipse 的 hibernate 配置文件(*.hbm.xml)加上自动提示功能
- 转载:为 eclipse 的 hibernate 配置文件(*.hbm.xml)加上自动提示功能
- eclipse hibernate配置文件(*.hbm.xml)加上自动提示功能