Here we only want to exclude the class from a specific class path, say
com.abc.projectA.service.orderService.sectionA.orderService.class
However, there is another class with the same name, but in a different class path
com.abc.projectA.service.orderService.sectionB.orderService.class
so only filer by class name will not work.
But I tried the following method:
<context:component-scan base-package="com.abc"> <context:exclude-filter expression="projectA\.service\.orderService\.sectionA\.orderService" type="regex" /> </context:component-scan>
This does not work. So, I'm sure that <context:exclude-filter> is only valid at the package level, but not for a specific class? If so, how do you exclude a class from the bean injection so that we can select and select with the class to get a wired connection with the same class name?
Thanks in advance.
Dreamer
source share