/**
-
@team 美奇软件开发工作室
-
@author QQ:15577969
-
@version 1.0
-
@date ${DATE} ${TIME}
*/
六、添加application.properties配置文件
1、application.properties在src\main\resources目录下
2、 application.properties内容
HTTP服务端口(TCP)
server.port=8080
数据库连接配置
spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/pay_db?characterEncoding=utf-8
spring.datasource.username=root
spring.datasource.password=root
spring.datasource.driverClassName=com.mysql.jdbc.Driver
自动生成表结构
spring.jpa.generate-ddl=true
spring.jpa.show-sql=true
spring.jpa.hibernate.ddl-auto=none
Druid连接池的配置信息
spring.datasource.initialSize=5
spring.datasource.minIdle=5
spring.datasource.maxActive=20
spring.datasource.maxWait=60000
spring.datasource.timeBetweenEvictionRunsMillis=60000
spring.datasource.minEvictableIdleTimeMillis=300000
spring.datasource.validationQuery=SELECT 1 FROM DUAL
spring.datasource.testWhileIdle=true
spring.datasource.testOnBorrow=false
spring.datasource.testOnReturn=false
spring.datasource.poolPreparedStatements=true
spring.datasource.maxPoolPreparedStatementPerConnectionSize=20
spring.datasource.filters=stat,wall,log4j
spring.datasource.connectionProperties=druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
#Redis(需要启动Redis) start
Redis数据库索引(默认为0)
spring.redis.database=0
Redis服务器地址
spring.redis.host=127.0.0.1
Redis服务器连接端口
spring.redis.port=6379
Redis服务器连接密码(默认为空)
spring.redis.password=
连接超时时间(毫秒)
spring.redis.timeout=50000
#Redis end
#thymeleaf start
#视图解析器的前缀放在这个文件夹
spring.thymeleaf.prefix=classpath:/templates/
#后缀
spring.thymeleaf.suffix=.html
#模式
spring.thymeleaf.mode=LEGACYHTML5
spring.thymeleaf.servlet.content-type=text/html
#编码格式
spring.thym
《一线大厂Java面试题解析+后端开发学习笔记+最新架构讲解视频+实战项目源码讲义》
【docs.qq.com/doc/DSmxTbFJ1cmN1R2dB】 完整内容开源分享
eleaf.encoding=utf-8
#不用缓存
spring.thymeleaf.cache=false
spring.resources.chain.strategy.content.enabled=true
spring.resources.chain.strategy.content.paths=/**
#thymeleaf end
七、System.out.println()的快捷键
直接输入sout,然后回车键,或者按Tab键
八、一个完整的pom.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”>
4.0.0
com.aher
seoSys
1.0-SNAPSHOT
seoSys
Demo project for Spring Boot
org.springframework.boot
spring-boot-starter-parent
2.3.4.RELEASE
<java.version>1.8</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
org.springframework.boot
spring-boot-starter-web
com.alibaba
druid
1.1.4
mysql
mysql-connector-java
5.1.44
org.springframework.boot
spring-boot-starter-data-jpa
org.springframework.boot
spring-boot-devtools
true
org.projectlombok
lombok
1.16.20
provided
org.springframework.boot
spring-boot-starter-redis
1.4.7.RELEASE
org.springframework.boot
spring-boot-starter-thymeleaf
net.sourceforge.nekohtml
nekohtml
1.9.22
org.springframework.boot
spring-boot-starter-cache