记录 spring 使用@Value获取properties文件中的属性值
生活随笔
收集整理的這篇文章主要介紹了
记录 spring 使用@Value获取properties文件中的属性值
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
使用@Value(${xxx}) 獲取properties文件的屬性值? 只需要在spring的配置文件中添加bean。
1 <bean id="propertyConfigurer" 2 class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> 3 <property name="location"> 4 <value>classpath:config.properties</value> 5 </property> 6 </bean>有多個文件需要加載的話 可以在 property 標簽中添加一個 list 標簽存放的多個value。
轉載于:https://www.cnblogs.com/dengsheng/p/11200948.html
總結
以上是生活随笔為你收集整理的记录 spring 使用@Value获取properties文件中的属性值的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: TCP/IP协议学习
- 下一篇: npm学习(二)之如何防止权限错误