I am using Spring 3.
In my application context xml file I would like to use component-scan and start in my root package com.mysite and not explicitly add every package:
would like to do
<context:component-scan base-package="com.mysite"/>
not:
<context:component-scan base-package="com.mysite.util"/>
<context:component-scan base-package="com.mysite.transactions"/>
<context:component-scan base-package="com.mysite.etc"/>
Is there a performance hit for either way?
Is there a recommended spring 3 way to do this?
Not much (May be a few milli sec) as it is one time thing and it does only when the container starts up for the first time. But it is always recommended to narrow down the scan path.