我正在尝试使用apache commons配置替换spring应用程序中的PropertiesFactoryBean。
在我看来,但是commons配置框架与PropertyPlaceHolderConfigurer和@Value注释不兼容。
如果您建议我使用解决方案,请注意我的弹簧只配置了xml。
谢谢, 马里奥
答案 0 :(得分:1)
你是对的。 commons-config很古老,不会从花园蜗牛那里知道@nnotation。 @Value意味着涉及反射和检查注释的大量昂贵机制 - 如果你仍然需要@Value,你可能需要重新考虑摆脱Spring。
答案 1 :(得分:0)
供将来参考:之前的答案不再正确。 Commons Configuration能够与PropertyPlaceholderConfigurer交互,请参阅 http://commons.apache.org/proper/commons-configuration/userguide/howto_utilities.html#Use_Configuration_in_Spring了解详情。