spring MVC+Spring+Mybatis的架构
我的扫描配置如下:
<context:component-scan base-package="com.pp.susf">
<context:include-filter type="annotation" expression="org.springframework.stereotype.Controller" />
<context:include-filter type="annotation" expression="org.springframework.stereotype.Service" />
</context:component-scan>
在一个类中使用如下注解注入不可行:
@Autowired
private ITestService testService;
而在Controller中
@Autowired
private ITestService testService;
则调用正常