0

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 annotations?

Affe
  • 47,174
  • 11
  • 83
  • 83
fastcodejava
  • 39,895
  • 28
  • 133
  • 186

1 Answers1

6

Using the @Value annotation. It supports SpEL as well, which means you can load a properties file and have @Value("${someConfigurationProperty}")

Bozho
  • 588,226
  • 146
  • 1,060
  • 1,140