1 2 3 4 5 6 7 8 9 10 | < bean id = "configProperties" class = "org.springframework.fig.PropertiesFactoryBean" > < property name = "locations" > < list > < value >classpath*:META-INF/spring/*.properties</ value > </ list > </ property > </ bean > < bean id = "propertyConfigurer" class = "org.springframework.fig.PreferencesPlaceholderConfigurer" > < property name = "properties" ref = "configProperties" /> </ bean > |
1 2 3 4 5 6 7 | import org.springframework.beans.factory.annotation.Value; @Value ( "#{configProperties['test.value']}" ) private String testValue; System.out.println( "TestValue Is: " + testValue); // 输出结果 Test Value Is: iloveyou 出处: |
本文发布于:2024-01-28 16:09:28,感谢您对本站的认可!
本文链接:https://www.4u4v.net/it/17064293718623.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
留言与评论(共有 0 条评论) |