server:
port: 8089
servlet:
context-path: /Student
#访问就通过http://localhost:8089/Student
spring:
datasource:
name: test
url: jdbc:mysql://localhost:3306/Student4
username: root
password: root
# 使用druid数据源 就应该写type:com.alibaba.druid.pool.DruidDataSource
type: org.apache.commons.dbcp.BasicDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
tomcat:
max-active: 150
min-idle: 5
max-idle: 20
initial-size: 30
log-abandoned: true
remove-abandoned: true
remove-abandoned-timeout: 10
time-between-eviction-runs-millis: 600000
min-evictable-idle-time-millis: 300000
validation-query: SElECT'x'
test-while-idle: true
test-on-return: false
#打开PSCache,并指定每个连接上PSCache的大小。oracle设为true,mysql设为false。分库分表较多推荐设置为false
thymeleaf:
cache: false #缓存
prefix: classpath:/templates/ # 模板文件路径前缀
suffix: .html
encoding: UTF-8
mode: HTML5
enabled: true #是否启用thymeleaf作为视图解析
enable-spring-el-compiler: true # 是否spring el 表达式
# filters: stat
# maxActive: 20
# initialSize: 1
# maxWait: 60000
# minIdle: 1
# timeBetweenEvictionRunsMillis: 60000
# minEvictableIdleTimeMillis: 300000
# validationQuery: select 'x'
# testWhileIdle: true
# testOnBorrow: false
# testOnReturn: false
# poolPreparedStatements: true
# maxOpenPreparedStatements: 20
## 该配置节点为独立的节点,有很多同学容易将这个配置放在spring的节点下,导致配置无法被识别
mybatis:
mapper-locations: classpath:mapping/*.xml #注意:一定要对应mapper映射xml文件的所在路径,告诉它映射文件放在哪里
type-aliases-package: com.example.demo.vo # 注意:对应实体类的路径,别名所在的包
configuration:
call-setters-on-nulls: true
cache-enabled: false
application.properties的一些配置
最新推荐文章于 2024-06-17 20:26:49 发布