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
  • 46,204
  • 11
  • 81
  • 82
fastcodejava
  • 37,849
  • 27
  • 129
  • 182

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
  • 572,413
  • 138
  • 1,043
  • 1,132