第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

[Spring] 多個 PropertyPlaceholderConfigurer 導(dǎo)致占位符未替換問題

[Spring] 多個 PropertyPlaceholderConfigurer 導(dǎo)致占位符未替換問題

瀟瀟雨雨 2019-05-21 11:11:15
這是一個Spring項目,第一個PropertyPlaceholderConfigurer,在context-aaa.xml主要是配置JDBCpropertiesclasspath:jdbc.properties其中,jdbc.properties的內(nèi)容如下:test.datasource.url=jdbc:mysql://192.168.0.66:3306/devtest.datasource.username=roottest.datasource.password=123456第二個PropertyPlaceholderConfigurer,在context-bbb.xml,功能是從數(shù)據(jù)里加載properties問題來了,加載DruidDataSource時,占位符并沒有被替換。我已經(jīng)加了PropertyPlaceholderConfigurer的order屬性排序,以及ignoreUnresolvablePlaceholders為true了,但是問題依舊。DruidDataSource作為第二個PropertyPlaceholderConfigurer的依賴,它的配置占位符不會被處理嗎?我斷點發(fā)現(xiàn),BeanFactoryPostProcessor的處理,在程序的報錯之后才執(zhí)行,是怎么回事?https://jira.spring.io/browse...我找到了解決方案:Thealternativeisto(a)usethenewPropertySourcesPlaceholderConfigurerinsteadofthetraditionalPropertyPlaceholderConfigurer;(b)eliminatethefirstPropertySourcesPlaceholderConfigurer;(c)registeraPropertySourcewiththeApplicationContext'sEnvironmentthatcontainsthepropertiesfortheplaceholdersthatneedreplacementinthePropertySourcesPlaceholderConfigurer我想問第三步怎么操作???
查看完整描述

2 回答

  • 2 回答
  • 0 關(guān)注
  • 1643 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號