Apache公共配置与PropertyPlaceHolderConfigurer的兼容性

问题描述 投票:2回答:2

我试图使用apache commons配置替换spring应用程序中的PropertiesFactoryBean。

在我看来,但是commons配置框架与PropertyPlaceHolderConfigurer和@Value注释不兼容。

如果你建议我一个解决方案,请注意我的弹簧配置只有xml。

谢谢,马里奥

spring annotations apache-commons
2个回答
1
投票

你是对的。 commons-config很古老,不会从花园蜗牛那里知道@nnotation。 @Value意味着大量昂贵的机制,包括反射和检查注释 - 如果你仍然需要@Value,你可能需要重新考虑摆脱Spring。


0
投票

供将来参考:之前的答案不再正确。 Commons Configuration能够与PropertyPlaceholderConfigurer交互,有关详细信息,请参阅http://commons.apache.org/proper/commons-configuration/userguide/howto_utilities.html#Use_Configuration_in_Spring

© www.soinside.com 2019 - 2024. All rights reserved.