码迷,mamicode.com
首页 > 移动开发 > 详细

springBoot中application.properties的常用配置

时间:2018-11-17 20:44:23      阅读:160      评论:0      收藏:0      [点我收藏+]

标签:roo   username   ali   Fix   jdb   ann   内嵌   端口   utf-8   

记录是为了更好的成长!

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=false
#spring.thymeleaf.prefix=classpath:/templates/
#spring.thymeleaf.check-template-location=true
#spring.thymeleaf.suffix=.html
#spring.thymeleaf.encoding=UTF-8
#spring.thymeleaf.content-type=text/html
#spring.thymeleaf.mode=HTML5

3、定义banner输出信息

#可以自定义输出信息的位置
#banner.location=xxx.txt
#指定编码格式
#banner.charset=utf-8
#banner图开启或者打印模式
#spring.main.banner-mode=console/off

4、配置端口和项目名访问

#指定springboot内嵌容器启动的端口,默认使用tomcat容器时在8080端口    
#server.port=8081
#配置项目访问路径
#server.servlet.context-path=/boot

5、数据持久化配置

#是否打印sql语句
#spring.jpa.show-sql= true
#mybatis配置文件路径
#mybatis.config-location=classpath:MyBatis.xml
#mybatis.mapper-locaitons=classpath:mybatis/mappings/*.xml

#别名实体包,多个逗号隔开
#mybatis.type-aliases-package=com.user.bean

 

 

 

 

 

 

 

 

 

 

以上内容代表个人观点,仅供参考,不喜勿喷。。。

springBoot中application.properties的常用配置

标签:roo   username   ali   Fix   jdb   ann   内嵌   端口   utf-8   

原文地址:https://www.cnblogs.com/newbest/p/9975151.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!