一:内切的server(配置server)
对server的几个常用的配置做个简单的说明:
代码片
.
server:
port: 8080
servlet:
session:
timeout: 30m
#session在30分钟后过期
context-path: /
#不配置的话就默认为 / 如果server.context-path = “/market/task”, 请求的url地址就是 localhost : port/market/task/ + url
tomcat:
max-http-post-size: -1
# 如果将值设置为 0,表示 POST 最大值为 0,不限制 POST 大小需要将值设置为 -1。
二:Tomcat
Tomcat为SpringBoot默认容器,下面是几个常用的配置
tomcat:
max-http-post-size: -1
# 如果将值设置为 0,表示 POST 最大值为 0,不限制 POST 大小需要将值设置为 -1。
三:spring
spring:
http:
encoding:
charset: UTF-8
enabled: true
force: true
messages:
encoding: UTF-8
mvc:
view:
prefix: /webpage/
suffix: .jsp
datasource:
name: dataSource
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://47.95.124.75:3306/zztest?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&serverTimezone=GMT%2b8&useSSL=false
username: root
password: Pa55w0rd#75
type: com.alibaba.druid.pool.DruidDataSource
druid:
initial-size: 1
min-idle: 1
max-active: 20
max-wait: 30000
time-between-eviction-runs-millis: 60000
min-evictable-idle-time-millis: 300000
test-while-idle: true
test-on-borrow: false
test-on-return: false
pool-prepared-statements: true
max-pool-prepared-statement-per-connection-size: 100
jpa:
show-sql: true
open-in-view: true
hibernate:
ddl-auto: none
naming:
physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
implicit-strategy: org.hibernate.boot.model.naming.ImplicitNamingStrategyJpaCompliantImpl
database: mysql
properties:
hibernate:
dialect: org.hibernate.dialect.MySQL57Dialect
show_sql: false
format_sql: false
current_session_context_class: org.springframework.orm.hibernate5.SpringSessionContext
cache:
use_second_level_cache: false
use_query_cache: false