spring-boot 中application.properties的各种配置

########################################################
###datasource connect mysql
########################################################
spring.datasource.url = jdbc:mysql://localhost:3306/springboot_db
spring.datasource.username = root
spring.datasource.password = 521314
spring.datasource.driverClassName = com.mysql.jdbc.Driver
spring.datasource.max-active=20
spring.datasource.max-idle=8
spring.datasource.min-idle=8
spring.datasource.initial-size=10

########################################################
### server
########################################################
#server.port=8080
#server.address= # bind to a specific NIC
#server.session-timeout= # session timeout in seconds
#the context path, defaults to ‘/‘
#server.context-path=/spring-boot
#server.servlet-path= # the servlet path, defaults to ‘/‘
#server.tomcat.access-log-pattern= # log pattern of the access log
#server.tomcat.access-log-enabled=false # is access logging enabled
#server.tomcat.protocol-header=x-forwarded-proto # ssl forward headers
#server.tomcat.remote-ip-header=x-forwarded-for
#server.tomcat.basedir=/tmp # base dir (usually not needed, defaults to tmp)
#server.tomcat.background-processor-delay=30; # in seconds
#server.tomcat.max-threads = 0 # number of threads in protocol handler
#server.tomcat.uri-encoding = UTF-8 # character encoding to use for URL decoding

########################################################
### Java Persistence Api
########################################################
# Specify the DBMS
spring.jpa.database = MYSQL
# Show or not log for each sql query
spring.jpa.show-sql = true
# Hibernate ddl auto (create, create-drop, update)
spring.jpa.hibernate.ddl-auto = update
# Naming strategy
#[org.hibernate.cfg.ImprovedNamingStrategy #org.hibernate.cfg.DefaultNamingStrategy]
spring.jpa.hibernate.naming-strategy = org.hibernate.cfg.ImprovedNamingStrategy
# stripped before adding them to the entity manager)
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5Dialect

########################################################
###THYMELEAF (ThymeleafAutoConfiguration)  引擎模版thymeleaf
########################################################
#前缀 在classpath路径下的templates目录中有.html文件
#spring.thymeleaf.prefix=classpath:/templates/
#后缀
spring.thymeleaf.suffix=.html
#spring.thymeleaf.mode=LEGACYHTML5
#spring.thymeleaf.mode=HTML5
#spring.thymeleaf.encoding=UTF-8
# ;charset=<encoding> is added
#spring.thymeleaf.content-type=text/html
# set to false for hot refresh
#false关闭缓存
spring.thymeleaf.cache=false

########################################################
###FREEMARKER (FreeMarkerAutoConfiguration) freemarker 模版
########################################################
spring.freemarker.allow-request-override=false
spring.freemarker.cache=false
spring.freemarker.check-template-location=true
spring.freemarker.charset=UTF-8
spring.freemarker.content-type=text/html
spring.freemarker.expose-request-attributes=false
spring.freemarker.expose-session-attributes=false
spring.freemarker.expose-spring-macro-helpers=false
#spring.freemarker.prefix=
#spring.freemarker.request-context-attribute=
#spring.freemarker.settings.*=
spring.freemarker.suffix=.ftl
#spring.freemarker.template-loader-path=classpath:/templates/ #comma-separated list
#spring.freemarker.view-names= # whitelist of view names that can be resolved

时间: 2024-07-31 01:29:42

spring-boot 中application.properties的各种配置的相关文章

spring boot项目application.properties多环境配置文件、jar包外部配置文件

一.简介 spring boot项目application.properties文件存放及使用介绍 二.方法一多环境配置文件 我们一般都会有多个应用环境,开发环境.测试环境.生产环境,各个环境的配置会略有不同,我可以根据这个创建多份配置文件,由主配置文件来控制读取那个子配置 创建spring boot项目后可以同时创建多个.properties文件,只要符合它要求的格式即可 格式:application-{profile}.properties:{profile}是变量用于自定义配置文件名称 分

Spring Boot2 系列教程(四)理解Spring Boot 配置文件 application.properties

在 Spring Boot 中,配置文件有两种不同的格式,一个是 properties ,另一个是 yaml . 虽然 properties 文件比较常见,但是相对于 properties 而言,yaml 更加简洁明了,而且使用的场景也更多,很多开源项目都是使用 yaml 进行配置(例如 Hexo).除了简洁,yaml 还有另外一个特点,就是 yaml 中的数据是有序的,properties 中的数据是无序的,在一些需要路径匹配的配置中,顺序就显得尤为重要(例如我们在 Spring Cloud

spring boot配置文件application.properties配置JPA以及数据源

1.application.properties配置jpa模板 spring.datasource.url=jdbc:mysql://localhost:3306/springboottest?useUnicode=true&characterEncoding=utf8&serverTimezone=UTC spring.datasource.username=rootspring.datasource.password=Zp970321spring.datasource.driver-c

Spring Boot 项目 application.properties配置说明

#======================================================================================# ★☆★☆★☆★☆★☆ spring boot 配置中心 ★☆★☆★☆★☆★☆#====================================================================================== springBoot application.properties 基

Spring boot配置文件application.properties

# =================================================================== # COMMON SPRING BOOT PROPERTIES # # This sample file is provided as a guideline. Do NOT copy it in its # entirety to your own application.               ^^^ # =====================

Spring boot配置文件 application.properties

# =================================================================== # COMMON SPRING BOOT PROPERTIES # # This sample file is provided as a guideline. Do NOT copy it in its # entirety to your own application.               ^^^ # =====================

Spring Boot Common application properties(转载)

转自官方文档:http://docs.spring.io/spring-boot/docs/current/reference/html/common-application-properties.html 版本:1.5.4.RELEASE # =================================================================== # COMMON SPRING BOOT PROPERTIES # # This sample file is pro

附录 B. Spring Boot 配置文件 application.properties

#########COMMON SPRING BOOT PROPERTIES ######========CORE PROPERTIES=========== #SPRING CONFIG (ConfigFileApplicationListener) spring.config.name= # config file name (default to 'application') spring.config.location= # location of config file #PROFIL

Spring Boot 配置文件application.properties

#########COMMON SPRING BOOT PROPERTIES ######========CORE PROPERTIES=========== #SPRING CONFIG (ConfigFileApplicationListener) spring.config.name= # config file name (default to 'application') spring.config.location= # location of config file #PROFIL

springBoot中application.properties的常用配置

记录是为了更好的成长! 1.数据库连接配置 #描述数据源 spring.datasource.url=jdbc:mysql://localhost:3306/demo spring.datasource.username=root spring.datasource.password=0000 spring.datasource.driver-class-name=com.mysql.jdbc.Driver 2.thymeleaf组件配置 #spring.thymeleaf.cache=fals