MyBatis xml文件中代码自动提示

2025-10-26 08:35:53

1、一、获得mybatis-3-config.dtd、mybatis-3-mapper.dtd 这两个文件。

建立一个Maven的项目

在Pom.xml文件中的Mybatis jar包的下载设置(也可以从网上直接找到需要的两个dtd文件)。

MyBatis xml文件中代码自动提示

2、 

得到mybatis-3.1.1. jar包的位置

MyBatis xml文件中代码自动提示

3、找到mybatis-3.1.1. jar所在的文件夹

 

MyBatis xml文件中代码自动提示

4、 

 

将其复制到D:\MyBatis代码自动提示 文件夹下

MyBatis xml文件中代码自动提示

5、 

然后解压,得到mybatis-3-config.dtd、mybatis-3-mapper.dtd包

 

MyBatis xml文件中代码自动提示

6、复制到D:\MyBatis代码自动提示 文件夹下。

 

MyBatis xml文件中代码自动提示

1、 

 

二、配置

主配置文件

 

MyBatis xml文件中代码自动提示

2、 

映射文件

 

 

MyBatis xml文件中代码自动提示

3、 

打开eclipse【windows】-->【preference】-->【XML】-->【XML Catalog】页面

MyBatis xml文件中代码自动提示

MyBatis xml文件中代码自动提示

4、进行配置:

 

MyBatis xml文件中代码自动提示

5、Location填mybatis-3-config.dtd文件的本地地址:

Key type 填public ID时:key为-//mybatis.org//DTD Config 3.0//EN

Key type 填URI时:key填http://mybatis.org/dtd/mybatis-3-config.dtd

配置好后点ok即可。

映射文件代码提示有关的配置同上。

1、注意:打开方式要以XMl Editor的方式

MyBatis xml文件中代码自动提示

声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
猜你喜欢