3.SpringBoot-properties配置
来源:互联网 发布:jquery.history.js 编辑:程序博客网 时间:2024/05/17 06:38
一.自动配置内容
更多请查看:http://docs.spring.io/spring-boot/docs/1.2.3.RELEASE/reference/html/common-application-properties.html
1.mysql数据库配置
如果你设置spring.datasource.driverClassName=com.mysql.jdbc.Driver,然后这个类就会被自动加载。
DataSource配置通过外部配置文件的spring.datasource.*属性控制。
实例:
spring.datasource.url=jdbc:mysql://localhost/test
spring.datasource.username=dbuser
spring.datasource.password=dbpass
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
其他可选的配置可以查看DataSourceProperties。
2.redis配置
实例:
spring.redis.port=6379
spring.redis.database=0
spring.redis.password=
spring.redis.timeout=2000
3.设置生效的profie(多环境配置)
spring.profiles.active=production
server.port=80
4.设置随机数
#随机字符串com.bluecoffee.random.str=${random.value}
#随机intcom.bluecoffee.random.number=${random.int}
#随机longcom.bluecoffee.random.bigNumber=${random.long}
#10以内的随机数com.bluecoffee.random.test1=${random.int(10)}
5.属性注入
com.bluecoffee.space.title=‘题目’
- 3.SpringBoot-properties配置
- SpringBoot获取properties配置
- springboot-properties配置
- SpringBoot获取properties配置
- springboot application.properties配置
- springBoot--properties配置
- SpringBoot-application.properties配置清单
- springBoot基础系列--properties配置
- springBoot基础系列--properties配置
- springBoot读取配置application.properties
- springboot的application.properties配置
- SpringBoot初窥:application.properties配置
- springBoot基础系列--properties配置
- Springboot 随笔-- Properties 配置一坑
- springboot配置文件application.properties中的配置项
- springboot 学习笔记(二)--- properties 配置
- SpringBoot properties通用属性配置大全
- springboot 学习笔记(二)--- properties 配置
- WebView跳转网络地址
- Mac下安装emacs+cscopse+auto-complete
- 提高php执行效率的建议
- centos7 安装mariadb最新版并配置
- spring-boot junit 单元测试
- 3.SpringBoot-properties配置
- RxSwift样例五 GitHubSignup
- Android二维码扫描教程
- 利用build_tools 里的aapt查看 apk包信息(versionCode,versionName,包名等)
- HDOJ 1426 Sudoku Killer (DFS)
- 64位CentOS 6.5下搭建LAMP环境详细步骤
- 创建线程的方式
- Eclipse 快捷键
- Qtcreator远程调试出现“The selected build of GDB does not support Python scripting.It cannot be used .."