**一.WEB.XML 头标签**
<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"
metadata-complete="true">
</servlet-mapping>
二.IDEA 设置命令行中文
-Dfile.encoding=UTF-8
三. .WAR包
需要在pom.xml中有此配置才会出现tomcat 中的
<packaging>war</packaging>
![tomcat](https://img-blog.csdnimg.cn/20200929145747359.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzMxNjUzMzY5,size_16,color_FFFFFF,t_70#pic_center)
四. JDBC 字符编码问题
在自己的mysql库后面加上这行代码能解决时区错误
?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC
五. 数据库连接时区问题解决
connection URL string 中显式地设置时区( serverTimezone=Asia/Shanghai )
六.让项目能够识别全路径文件
src/main/resources
/*.properties
/.xml
true
src/main/java
**/.properties
**/*.xml
true