We inject simple property with configuration as shown below :
<bean id="myService" class="com.aaa.bbb.ccc.MyServiceImpl">
<property name="myProp" value=""/>
</bean>
How would you do it with annotat开发者_运维知识库ions?
Using the @Value
annotation. It supports SpEL as well, which means you can load a properties file and have @Value("${someConfigurationProperty}")
精彩评论