Spring Boot 使用IntelliJ IDEA创建一个web开发实例(五)
使用application.ym进行多环境配置
1.配置激活选项
spring:
profiles:
active: dev
2.在配置文件添加若干个英文状态下的短横线即可区分
spring:
profiles:
active: dev
server:
port : 8080
servlet:
context-path: /demo name : hello demo
---
spring:
profiles: dev
server:
port : 8082
servlet:
context-path: /demo2
name : hello demo dev
---
spring:
profiles: pro
server:
port : 8083
servlet:
context-path: /demo3
name : hello demo pro
---
spring:
profiles: test
server:
port : 8084
servlet:
context-path: /demo4
name : hello demo test
运行测试

修改激活配置
spring:
profiles:
active: test
测试

Spring Boot 使用IntelliJ IDEA创建一个web开发实例(五)的更多相关文章
- Spring Boot 使用IntelliJ IDEA创建一个web开发实例(一)
.新建项目File-->New-->Project-->Spring Initializr 点击Finish,一个Spring Boot web应用就创建好了.
- Spring Boot 使用IntelliJ IDEA创建一个web开发实例(二)
1. 创建一个Controller类 package com.example.demo; import org.springframework.web.bind.annotation.RequestM ...
- Spring Boot 使用IntelliJ IDEA创建一个web开发实例(四)
多环境配置 1. 在springBoot多环境配置文件名需要满足application-{profile}.properties的格式,其中{profile}对应你的环境标识,例如: (1)appli ...
- Spring Boot 使用IntelliJ IDEA创建一个web开发实例(三)
属性配置 1.配置application.properties文件 配置web访问端口和context path server.port = 8081 server.servlet.context-p ...
- Intellij Idea 创建一个Web项目
今天想用IDEA创建一个web项目: 准备工具 1.jdk1.7 2.tomcat6.0,由于下载的8.5没有lib目录不能配置改6.0 3.idea2019.1.2 Intellij Idea的安装 ...
- Spring MVC 学习笔记2 - 利用Spring Tool Suite创建一个web 项目
Spring MVC 学习笔记2 - 利用Spring Tool Suite创建一个web 项目 Spring Tool Suite 是一个带有全套的Spring相关支持功能的Eclipse插件包. ...
- Spring Boot 多模块项目创建与配置 (一) (转)
Spring Boot 多模块项目创建与配置 (一) 最近在负责的是一个比较复杂项目,模块很多,代码中的二级模块就有9个,部分二级模块下面还分了多个模块.代码中的多模块是用maven管理的,每个模块都 ...
- Spring Boot 多模块项目创建与配置 (一)
最近在负责的是一个比较复杂项目,模块很多,代码中的二级模块就有9个,部分二级模块下面还分了多个模块.代码中的多模块是用maven管理的,每个模块都使用spring boot框架.之前有零零散散学过一些 ...
- Spring Boot 多模块项目创建与配置 (转)
转载:https://www.cnblogs.com/MaxElephant/p/8205234.html 最近在负责的是一个比较复杂项目,模块很多,代码中的二级模块就有9个,部分二级模块下面还分了多 ...
随机推荐
- mvc拦截请求IHttpModule
代码: using System; using System.Collections.Generic; using System.Linq; using System.Web; using Syste ...
- salt-api使用
salt-api 基本使用 目前salt API 支持的web模块如下: CherryPy Tornado WSGI 1.安装salt-api salt 使用 CherryPy来实现restful的a ...
- 四则运算结对项目之GUI
本次结对编程让我学到了许多许多知识,受益匪浅!在此之前,我没想过我能做出一个双击运行的小程序. 感谢我的队友与我同心协力,感谢室友宇欣告诉我操作符为“最多多少”而不是“多少”并教我使用效能分析工具,感 ...
- [转帖] CentOS7 与 CentOS6的对比
来源网站: http://blog.51cto.com/fengery/1901349 centos6.x_centos7.x差异改进明细 感谢原作者 centos官方帮助文档:https://wik ...
- Task的运行原理和工作窃取
在net4.0以前,当调用ThreadPool.QueueUserWorkItem方法往线程池中插入作业时,会把作业内容(其实就是一个委托)放到线程池中的一个全局队列中,然后线程池中的线程按照先进先出 ...
- Mysql 的InnoDB事务方面的 多版本并发控制如何实现 MVCC
Mysql的MVCC不能解决幻读的问题,但是Mysql还有间隙锁功能,Mysql的间隙锁工作在Repeatable Read隔离级别下面,可以防止幻读, 参考:Mysql 间隙锁原理,以及Repeat ...
- redis压力测试工具-----redis-benchmark
redis做压测可以用自带的redis-benchmark工具,使用简单 压测命令:redis-benchmark -h 127.0.0.1 -p 6379 -c 50 -n 10000 压测需要一段 ...
- MachineLearning Exercise 7 : K-means Clustering and Principle Component Analysis
findClosestCentroids.m m = size(X,); :m [value index] = min(sum((repmat(X(i,:),K,)-centroids).^,)); ...
- Graph And Its Complement CodeForces - 990D(思维构造)
题意: 图中有n个点,开始有a个连通块,然后连着的边断开,不连的边连上,变为b个连通块,输出原图的邻接矩阵. 解析: 原图中连通块大于1的图,经过上述操作后,一定变成只有1个连通块的图. 若n != ...
- JDK中的SimpleDateFormat线程非安全
在JDK中使用SimpleDateFormat的时候都会遇到线程安全的问题,在JDK文档中也说明了该类是线程非安全的,建议对于每个线程都创建一个SimpleDateFormat对象.如下面一个Case ...