0

I know that if I want use the JSR-250 annotations inside a Spring application configured by XML configuration file I have to put this tag inside the XML configuration file:

<context:annotation-config/>

But what I need to do to activate the JSR-250 annotations if I am using a Java configuration class or the annotations config instead the XML based configuration for my application?

Java Surfer
  • 613
  • 3
  • 9
  • 13

1 Answers1

1

The equivalent to <context:annotation-config/> is @AnnotationDrivenConfig:

@Configuration
@AnnotationDrivenConfig
public class Config {
    // may now use @Autowired to reference beans from other @Configuration classes, XML, etc
}
fateddy
  • 6,887
  • 3
  • 22
  • 26