Can someone explain what ** means in the context of spring configuration?
<context:component-scan base-package="ab**" />
and how is this different from
<context:component-scan base-package="ab" />
I could not find anything about how to use the / ant template paths in the base package attribute of the check component element.
Could you also point me to any documentation / source code that would explain the use of wildcards in the attribute of a scan component? My google-fu is useless
EDIT: I did a few more experiments based on the accepted answer, now it all makes sense to know how the attribute value of the base package is "converted" to the resource string.
So, I created two managed components of spring
abSpringBean2 abcdSpringBean1
SpringBean1 uses SpringBean2 using @Autowired
therefore not only this:
<context:component-scan base-package="ab"/>
and this:
<context:component-scan base-package="ab**"/>
work fine in the sense that SpringBean2 may be correctly allowed for input in SpringBean1, but they will also work:
<context:component-scan base-package="ab**.**.**"/> <context:component-scan base-package="ab**"/> <context:component-scan base-package="ab*"/>
This will result in an error with NoSuchBeanDefinitionException due to an unresolved type of SpringBean2:
<context:component-scan base-package="ab*"/>
artur source share