中文亚洲精品无码_熟女乱子伦免费_人人超碰人人爱国产_亚洲熟妇女综合网

當(dāng)前位置: 首頁 > news >正文

畢設(shè)網(wǎng)站可以用axure做嗎軟文營銷怎么寫

畢設(shè)網(wǎng)站可以用axure做嗎,軟文營銷怎么寫,整合營銷方案案例,長沙銘萬做網(wǎng)站文章目錄 SpringBoot 的多配置文件spring.profiles.active 配置Profile 和 ActiveProfiles 注解 SpringBoot 的多配置文件 spring.profiles.active 配置 默認(rèn)情況下,當(dāng)你啟動 SpringBoot 項(xiàng)目時,會在日志中看到如下一條 INFO 信息: No act…

文章目錄

    • SpringBoot 的多配置文件
      • spring.profiles.active 配置
      • @Profile 和 @ActiveProfiles 注解

SpringBoot 的多配置文件

spring.profiles.active 配置

默認(rèn)情況下,當(dāng)你啟動 SpringBoot 項(xiàng)目時,會在日志中看到如下一條 INFO 信息:

No active profile set, falling back to default profiles: default

image.png

這條消息是在告訴你,由于你沒有激活、啟用某個配置文件,SpringBoot 使用了默認(rèn)的配置文件,也就是 application.propertiesapplication.yml 。當(dāng)然,這并不是什么錯誤。

SpringBoot 允許我們的項(xiàng)目提供多配置文件,并『激活、啟用』其中的某一個。這些配置文件的命名規(guī)則為:application-xxx.propertiesapplication-xxx.yml

提供多個配置文件之后,你在 SpringBoot 默認(rèn)加載的配置文件 application.propertiesapplication.yml 中只用寫一個配置項(xiàng),用以激活、啟用某個 .properties.yml 即可。例如:

spring:profiles:active: dev

上例中的 dev 就是 application-xxx.propertiesapplication-xx.yml 中的那個 xxx 。

現(xiàn)在你再啟動 SpringBoot,你會看到如下的 INFO 信息:

The following profiles are active: dev

這表示 SpringBoot 本次啟動使用的就是這個配置文件。

@Profile 和 @ActiveProfiles 注解

了解

@Profile 注解配合 spring.profiles.active 參數(shù),也可以實(shí)現(xiàn)不同環(huán)境下(開發(fā)、測試、生產(chǎn))配置參數(shù)的切換。

另外,@ActiveProfiles 注解(在測試環(huán)境中)可以起到 spring.profiles.active 參數(shù)的作用。

@Configuration
public class MyConfiguration {@Bean@Profile("xxx")public Human tommy() {return new Human("tom", 20);}@Bean@Profile("yyy")public Human jerry() {return new Human("jerry", 19);}}

在上面的配置中:

  • 存在 2 套配置:xxxyyy
  • name 為 tommy 的 Human Bean 僅存在于 xxx 的配置套餐中;
  • name 為 jerry 的 Human Bean 僅存在于 yyy 的配置套餐中;

在 application.yml 配置文件通過 active 配置激活啟動一個:

spring:profiles:active: yyy

我們可以在 JUnit 中驗(yàn)證結(jié)果:

@SpringBootTest
class AppTest {@Autowiredprivate Human human;@Testpublic void demo() {System.out.println(human);  // 這里輸出的是 jerry Human Bean}
}

在測試類的使用中,你也可以將 application.yml 中的 active 配置項(xiàng)去掉,轉(zhuǎn)而在測試類的頭上使用 @ActiveProfiles 注解,也能起到同樣效果:

@SpringBootTest
ActiveProfiles(profiles = "xxx")
class AppTest {...
}
http://www.risenshineclean.com/news/55783.html

相關(guān)文章:

  • 網(wǎng)站建設(shè)的關(guān)鍵網(wǎng)絡(luò)推廣優(yōu)化工具
  • 生日祝福網(wǎng)頁鏈接制作360優(yōu)化大師官方網(wǎng)站
  • 政府網(wǎng)站建設(shè)匯報及時更新江蘇網(wǎng)站seo設(shè)計
  • 2018年網(wǎng)站優(yōu)化怎么做西安百度關(guān)鍵詞優(yōu)化
  • 一個vps可以建多少網(wǎng)站百度sem推廣
  • 移動端網(wǎng)站和微信網(wǎng)頁設(shè)計推廣軟文營銷案例
  • 網(wǎng)站標(biāo)題格式青島網(wǎng)絡(luò)科技公司排名
  • 做外貿(mào)商城網(wǎng)站谷歌瀏覽器app下載安裝
  • 曰本真人做爰免費(fèi)網(wǎng)站上海百度移動關(guān)鍵詞排名優(yōu)化
  • 南昌網(wǎng)站建設(shè)設(shè)計廣告營銷案例分析
  • 怎么申請自己的網(wǎng)站網(wǎng)址推廣賺錢的微信小程序
  • 封面型網(wǎng)頁網(wǎng)站有哪些優(yōu)秀網(wǎng)站設(shè)計欣賞
  • 打開網(wǎng)站彈出圖片代碼軟文推廣公司
  • flash教程網(wǎng)站首頁愛站查詢
  • 江西博網(wǎng)科技發(fā)展有限公司專業(yè)搜索引擎seo合作
  • 中文域名網(wǎng)站鏈接無法打開百度推廣網(wǎng)站一年多少錢
  • win2008系統(tǒng)做網(wǎng)站廣告設(shè)計公司
  • 網(wǎng)站設(shè)計做好的網(wǎng)站怎么優(yōu)化
  • 個人網(wǎng)站建設(shè)在哪里企業(yè)培訓(xùn)考試app
  • 淘寶代購網(wǎng)站怎么做網(wǎng)站推廣策劃書模板
  • 西寧網(wǎng)站建設(shè)加盟代理app營銷模式有哪些
  • 桂林網(wǎng)站建設(shè)公司鎮(zhèn)江百度公司
  • 山西住房城鄉(xiāng)建設(shè)部網(wǎng)站網(wǎng)店運(yùn)營怎么學(xué)
  • 長安網(wǎng)站建設(shè)做百度網(wǎng)站一年多少錢
  • 網(wǎng)站開發(fā)定制模板網(wǎng)站建設(shè)抖音seo排名系統(tǒng)哪個好用
  • 岳陽網(wǎng)站設(shè)計改版電子商務(wù)seo
  • 做門戶網(wǎng)站的系統(tǒng)seo公司賺錢嗎
  • 2019做網(wǎng)站賺錢么企業(yè)培訓(xùn)課程ppt
  • 網(wǎng)站截圖怎么做互聯(lián)網(wǎng)平臺推廣怎么做
  • 網(wǎng)站建設(shè)神器現(xiàn)在做網(wǎng)絡(luò)推廣都有什么方式