IntelliJ IDEA中创建xml文件
1、file—setting,左上角输入template,
2、在左侧栏找到File And Code Templates
3、中间选中Files
4、点击+号,添加模板
5、输入模板名字:Name:mybatis-cfg.xml (name可以自定义)
6、后缀名extension:xml
7、在面板中间输入内容:
8、把enable live Template(激活模板)勾选上
9、点击Apply—ok
10、选中模板,然后输入xml文件名字mybatis.cfg.xml
这里输入的代码我设置了我自己的:
<?xml version="1.0" encoding="UTF-8"?>
<project>
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
<modelVersion>4.0.0</modelVersion>
</project>
idea中默认创建出来的是:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
version="4.0">
</web-app>
其他的xml文件同理。