Spring3.X
总配置
这个是扫描全部业务类,除了注解为Controller的类。
然后在mvc的xml配置文件中单独配置扫描Controller
这个全部只扫描一次,可以避免重复扫描倒是事物无法被代理
总配置
<tx:annotation-driven />
<context:annotation-config />
<context:component-scan base-package="com.my9yu.manager">
<context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller"/>
</context:component-scan>
这个是扫描全部业务类,除了注解为Controller的类。
然后在mvc的xml配置文件中单独配置扫描Controller
<mvc:annotation-driven/>
<context:annotation-config />
<context:component-scan base-package="com.my9yu.manager.svn" use-default-filters="false">
<context:include-filter type="annotation" expression="org.springframework.stereotype.Controller"/>
</context:component-scan>
这个全部只扫描一次,可以避免重复扫描倒是事物无法被代理