业无高卑志当坚,男儿有求安得闲?这篇文章主要讲述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
【spring-boot 中application.properties的各种配置】
########################################################
###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
推荐阅读
- 网时粉丝经济下的APP以服务器为基础
- 线上教育app开发应该具备哪些功能
- Django学习案例一(blog)(一.创建项目APP)
- 安卓APP动态调试-IDA实用攻略
- CSAPP第二個實驗bomblab
- Android字符串在strings.xml文件的定义和使用
- 记一次踩坑(使用ksoap-android时造成的okhttp依赖冲突问题)
- create-react-app遇到的问题及解决方法
- Android中ListView异步加载图片错位重复闪烁问题分析及解决方案