The answer to @anubhava works, but it refers to the Spring 2.0 manual, which is 5 years old.
In the configuration XML Spring 3.x has a more elegant approach <context:annotation-config/>. It also provided a whole set of functions that you are likely to need, while RequiredAnnotationBeanPostProcessoronly a few allow.
See Spring 3.x manual .
@Bean -style, , @Required, , @Bean. , - Spring 3.1 -, , , .
, , 3.0.x.