I am mixed using AnnotationConfigApplicationContext and ClasspathXmlApplicationContext at the moment, and create AnnotationConfigApplicationContext as the parent context. But I found that beans, defined in AnnotationConfigApplicationContext , do a poor job with beans, defined in ClasspathXmlApplicationContext . So I would like to leave ClasspathXmlApplicationContext anyway and use only my AnnotationConfigApplicationContext application.
The problem is that I do not know how to completely replace <context:component-scan> . I can easily scan packets using AnnotationConfigApplicationContext.scan(...) , but there seems to be no way to add an include / exclude pattern to AnnotationConfigApplicationContext .
Any idea?
java spring annotations
Xiรจ Jรฌlรฉi
source share