1、file—setting,左上角输入template

2、在左侧栏找到File And Code Templates

3、中间选中Files 4、点击+号,添加模板

5、输入模板名字:Name:mybatis-cfg.xml (name可以自定义)

6、后缀名extension:xml 7、在面板中间输入内容:

<?xml version="1.0" encoding="utf-8" ?> 
<!DOCTYPE configuration 
        PUBLIC "-//mybatis.org//DTD Config 3.0//EN" 
        "http://mybatis.org/dtd/mybatis-3-config.dtd"> 
<configuration> 
</configuration> 

8、把enable live Template(**模板)勾选上

9、点击Apply—ok

10、选中模板,然后输入xml文件名字mybatis.cfg.xml

注意:Mybatis的DTD的Public ID没有写在DTD文件里面,可以在官方文档里面找到

--任何框架如果没有在DTD文件提供Public Id 的都去找官方文档。

IDEA配置SqlMapConfig模板

 

配置MyBatis的dtd约束   可省略

IDEA配置SqlMapConfig模板

以后每次创建都有对应模板提供如下模板:

IDEA配置SqlMapConfig模板

 

 

相关文章: